Partially paste

Share your favorite FastKeys commands
Post Reply
ThiasEsseboom
Posts: 8
Joined: Nov 7th, ’22, 16:03

Post by ThiasEsseboom » Mar 4th, ’23, 15:32

Hey all :-)

I'm trying to find out if it is possible to partially past something from the clipboard, or to partially use a text input.

For some context, for reservations we send out a link for customers to verify their details, but for the back office of this, we use a different link.

So customer will get this link: company.com/en/confirmation/123456789-987654321-123456789

And we use: bo.company.com/view/confirmation/123456789-987654321-123456789?=view

I would like to make it (if possible) so, that our CS team can just copy the link we sent out, and use a Fastkey to open the BO link.

So something like this:

Code: Select all

%INPUT_Link%
Get last 36 characters of %INPUT_Link%
Run, https://bo.etc/36characters?=view
Would this at all be possible, and if so, could someone help me on the way to creating this?
ThiasEsseboom
Posts: 8
Joined: Nov 7th, ’22, 16:03

Post by ThiasEsseboom » Mar 4th, ’23, 17:09

I've been trying this now

Code: Select all

Gui, New
Gui, Add, Text,, Paste URL
Gui, Add, Edit, vUrl
Gui, Add, Button, Default, OK
Gui, Show

ButtonOK:
Gui, Submit
Gui, Destroy
NewStr := SubStr(%Url%, -36)
run, https://bo.company.etc/%NewStr%
But now I don't get the time to input anything into the URL box, it closes instantly and just runs the website without the %NewStr%

Any ideas?
ThiasEsseboom
Posts: 8
Joined: Nov 7th, ’22, 16:03

Post by ThiasEsseboom » Mar 4th, ’23, 17:23

Sooo some redditing later, and I've created this :-) Which works perfectly!

Code: Select all

<+^v::
    txt := Clipboard
    txt := SubStr(txt, -36)
	Clipboard := txt

run, https://bo.company.etc/%clipboard%?=view
User avatar
Marko
Posts: 1714
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Mar 4th, ’23, 22:06

You could also make shortcut which copies to clipboard and then opens the link, all in one step.
Set the shortcut in FastKeys, Type: Command

Code: Select all

Send, ^c
Sleep, 100
txt := SubStr(Clipboard, -36)
run, https://bo.company.etc/%txt%?=view
ThiasEsseboom
Posts: 8
Joined: Nov 7th, ’22, 16:03

Post by ThiasEsseboom » Mar 5th, ’23, 07:39

Awesome :D Thank you
Post Reply