AlomWare Toolbox Forum

General Category => Help and Support => Topic started by: Sunny on December 14, 2025, 06:46:43 PM

Title: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Sunny on December 14, 2025, 06:46:43 PM
Hello,

Problem: I copy numbers like 06.12.65.11.22, 06 12 65 11 22 or 06/12/65/11/22
Goal: 0612651122 (digits only)

Wanted functionality:

Keyboard shortcut (Ctrl+Win+P)

Read clipboard

Remove spaces, dots, slashes

Put result back in clipboard

Ready to paste Ctrl+V

Can someone help me code this? Thanks!  :)
Title: Re: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Paul (Lead Developer) on December 14, 2025, 08:25:37 PM
Hi Sunny. This action will do it:

(Start)
TIP: Copy from Start to End to paste into an action.
0001 String: Assign from clipboard text ""
0002 String: Make numeric ""
0003 Clipboard: Assign text "string$"
(End)

Set the action's hotkey to Ctrl+Win+P, and it will convert the clipboard text to digits only, ready for pasting with Ctrl+V.
Title: Re: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Bazza on December 16, 2025, 05:22:19 PM
Could you make the hotkey paste it as well? Removing the need for Ctrl+V after conversion?
Title: Re: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Paul (Lead Developer) on December 16, 2025, 10:56:00 PM
Hi Bazza. Yes, you could add a single step at the end like this so that the hotkey pastes it:

(Start)
TIP: Copy from Start to End to paste into an action.
0001 String: Assign from clipboard text ""
0002 String: Make numeric ""
0003 Clipboard: Assign text "string$"
0004 Keyboard: Paste ""
(End)

Or, if you don't want to do it with several hotkeys (Ctrl+X, Ctrl+Win+P, and Ctrl+V) then you can make it cut the selected text, convert it, and paste it back all with one hotkey like this:

(Start)
TIP: Copy from Start to End to paste into an action.
0001 Keyboard: Cut ""
0002 String: Assign from clipboard text ""
0003 String: Make numeric ""
0004 Clipboard: Assign text "string$"
0005 Keyboard: Paste ""
(End)
Title: Re: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Sunny on December 18, 2025, 06:54:05 PM
Quote from: Paul (Lead Developer) on December 14, 2025, 08:25:37 PMHi Sunny. This action will do it:

(Start)
TIP: Copy from Start to End to paste into an action.
0001 String: Assign from clipboard text ""
0002 String: Make numeric ""
0003 Clipboard: Assign text "string$"
(End)

Set the action's hotkey to Ctrl+Win+P, and it will convert the clipboard text to digits only, ready for pasting with Ctrl+V.

Hello Paul,
I pasted the script and ran a test, but an error message appeared  :-[
(https://i.imgur.com/lqK1UzR.png)
Title: Re: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Paul (Lead Developer) on December 18, 2025, 08:20:36 PM
Yes, the Step's help says that "String: Make numeric" can only be used on single lines of clipboard text. The examples you posted were a single line (eg. "06/12/65/11/22").

Maybe you have copied a line break before and/or after the text? If so, you can remove them like this (Step 2):

(Start)
TIP: Copy from Start to End to paste into an action.
0001 String: Assign from clipboard text ""
0002 String: Remove line breaks "0"
0003 String: Make numeric ""
0004 Clipboard: Assign text "string$"
(End)

The "0" for Step 2's value means to NOT insert a space where the line breaks are. Specifying "1" will put a space.
Title: Re: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Sunny on December 22, 2025, 05:28:33 PM
Quote from: Paul (Lead Developer) on December 18, 2025, 08:20:36 PMYes, the Step's help says that "String: Make numeric" can only be used on single lines of clipboard text. The examples you posted were a single line (eg. "06/12/65/11/22").
Maybe you have copied a line break before and/or after the text? If so, you can remove them like this (Step 2):
(Start)
TIP: Copy from Start to End to paste into an action.
0001 String: Assign from clipboard text ""
0002 String: Remove line breaks "0"
0003 String: Make numeric ""
0004 Clipboard: Assign text "string$"
(End)

The "0" for Step 2's value means to NOT insert a space where the line breaks are. Specifying "1" will put a space.
Huge thanks Paul, it's all working perfectly now, you're a lifesaver  :D


Title: Re: Help with script - Clean phone number (spaces/dots/slashes → compact)
Post by: Paul (Lead Developer) on December 22, 2025, 05:37:31 PM
Good to hear, Sunny. Which gives me an idea: there's already an option to remove spaces from the start and end of copied lines, but maybe removing {Enter} from the start and end of copied text should be an option, too. After all, how often do we need extra blank copied lines? I've added this for the next update. :)