Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Macro mod request

Frank99's profile on WallpaperFusion.com
Hi, the attached macro will remove all whitespace characters from a highlighted string with auto copy/paste. Can someone help me modify it to also remove '+' and '-' from the string, for easily converting international phone numbers into just a numerical string? Thank you.
• Attachment [protected]: Remove all Whitespace Characters (with auto copy_paste).cfmacro [7,490 bytes]
Aug 23, 2022  • #1
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I put together a Macro that should work for you. It removes every character in the copied string that isn't a digit, then pastes the result. Here's how to get it into ClipboardFusion:

  • Download the file attached to this post
  • Open the ClipboardFusion Settings window
  • On the "Macros" tab, click the "Import" button
  • Select the file you downloaded in the first step
  • In the window that pops up, you can review the code and assign the Macro a HotKey
  • Click OK to close the Macro Edit window, then OK again to save and apply your changes

Thanks!
Aug 26, 2022  • #2
Frank99's profile on WallpaperFusion.com
Thank you! Could you actually change it to leave not just digits, but all alphanumeric characters? And to remove any punctuation, whitespace, line breaks, etc?
Aug 27, 2022  • #3
Frank99's profile on WallpaperFusion.com
Hmm, I tried the macro. After importing, I opened the macro to edit it, and there is text in the 'Input' tab, but when I click 'Run Function', there is no output on the 'Output' tab. Is there output when you do this?

Despite this, when I assign the macro a hotkey, and try it on Notepad text, it does work. Should I not expect to see text on the 'Output' tab of the macro edit window? I'm running 6.0 beta 4. Thanks.
Aug 27, 2022  • #4
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I've modified the macro above to keep letters as well as digits and attached the new version to this post. You can follow the steps above to get it to run in ClipboardFusion :)

Returning null on the Macro causes the output of the Macro to not show up in the output window, since setting it to null is essentially outputting nothing. To test it I commented out all of the copying/pasting functions, and returned the modified text variable after the Regex.Replace function is run. I didn't leave it this way for this final version though, because the paste function will set the Clipboard, then the Clipboard would be set again by the result of the Macro. This could slow the whole task down, as well as lock up the Clipboard for other programs.
• Attachment: Keep Alpha Numeric Characters.cfmacro [13,112 bytes]
27 days ago  • #5
Was this helpful?  Login to Vote(-)  Login to Vote(-)