Replace period with comma in clipboard? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Krd
Posts: 405
Joined: 10 Mar 2020, 02:46

Replace period with comma in clipboard?

23 Feb 2021, 10:06

Hello,

Code: Select all

Send, {Ctrl Down}c{Ctrl Up}
Sleep, 1000
Amount := Clipboard
Sleep, 500
Send, %Amount%
Where to add a line that would replace the value in Clipboard which is always in this format 500.00 to 500,00? The value before period is everthing from 1 to 100000.00.
And an option to just cut everthing from period?

So the code would copy this:
500.00
and send to to another place like this:
500,00


Thanks
User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: Replace period with comma in clipboard?  Topic is solved

23 Feb 2021, 10:11

Code: Select all

Send, {Ctrl Down}c{Ctrl Up}
Sleep, 1000
Amount := StRreplace(Clipboard, ".", ",")
Sleep, 500
Send, %Amount%
Better:

Code: Select all

Clipboard := ""
Send, {Ctrl Down}c{Ctrl Up}
ClipWait
Amount := StRreplace(Clipboard, ".", ",")
Send, %Amount%
But if you want to send to another place, you need something before the Send.
User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: Replace period with comma in clipboard?

23 Feb 2021, 10:17

To cut everything after and including the period:

Code: Select all

Clipboard := ""
Send, {Ctrl Down}c{Ctrl Up}
ClipWait
Amount := RegExReplace(Clipboard, "\..*")
Send, %Amount%
Krd
Posts: 405
Joined: 10 Mar 2020, 02:46

Re: Replace period with comma in clipboard?

23 Feb 2021, 10:37

Fantastic, much appreciated!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: OrangeCat and 127 guests