Help with automate the clipboard

Get help with using AutoHotkey and its commands and hotkeys
vxixcx
Posts: 6
Joined: 05 Nov 2020, 12:54

Help with automate the clipboard

10 Nov 2020, 18:42

Hi, im new with ahk so i need help.
In my work a use a website tool that is base in Unity. This tool has a little clipboard icon that copy a lot of info.
Somenting like this:
Vending Id: 1A Point x: 0.40465432
Vending Id: 1B Point y: 0.67181826
Vending Id: 1C Point x: 0.3858309
Vending Id: 1D Point x: 0.39336032
Vending Id: 1E Point y: 0.1483432
Vending Id: 1F Point y: 0.06780854
Vending Id: 2A Point x: 0.56653506
User: Jack

I only need the line "User" to paste in a excel file or in emails. I already have this little script:

Code: Select all

info := Clipboard
regexmatch(info, "User: \K.*+", out)
Clipboard := out
But with this script i need to click the exe file of ahk to have the result.
Is there a way to automate this?


Pd: i apologize if there is grammar mistakes, english is my second lenguage
zuzu_kuc
Posts: 35
Joined: 30 Mar 2016, 12:36

Re: Help with automate the clipboard

10 Nov 2020, 18:50

You can add shortcut
#singleinstance,force
F1::
Your code...
Return
vxixcx
Posts: 6
Joined: 05 Nov 2020, 12:54

Re: Help with automate the clipboard

10 Nov 2020, 18:57

So, i click the clipcboard icon in the tool, press F1 and just paste it?
User avatar
mikeyww
Posts: 3874
Joined: 09 Sep 2014, 18:38

Re: Help with automate the clipboard

10 Nov 2020, 19:02

Yes. Here's an example for F3.

Code: Select all

F3::Clipboard := Trim(RegExReplace(Clipboard, "(?s).*User: "), "`r`n")
Alternatively, you can send the text directly.

Code: Select all

F3::Send % Trim(RegExReplace(Clipboard, "(?s).*User: "), "`r`n")
vxixcx
Posts: 6
Joined: 05 Nov 2020, 12:54

Re: Help with automate the clipboard

10 Nov 2020, 19:07

Awesone.
Can i use the button "`" (the one up the button tab) or just can used it with the F1-F12?
User avatar
mikeyww
Posts: 3874
Joined: 09 Sep 2014, 18:38

Re: Help with automate the clipboard

10 Nov 2020, 19:10

Any key you want. Just change it accordingly.

Code: Select all

`::Send % Trim(RegExReplace(Clipboard, "(?s).*User: "), "`r`n")
vxixcx
Posts: 6
Joined: 05 Nov 2020, 12:54

Re: Help with automate the clipboard

10 Nov 2020, 19:33

Excellent, thank you so much for the help.

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, Bing [Bot], Google [Bot], mad3d, mikeyww, Quisquose, twstech and 64 guests