Help with V2 %clipboard% Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Spango911
Posts: 2
Joined: 23 May 2024, 08:08

Help with V2 %clipboard%

23 May 2024, 08:18

I had a hotkey under version 1.37 that was working perfectly. It would copy a cell in Excel that contained a customer ID and then it would open the customer in my company software by using the ID in the URL. Essentially it allowed me with one click from an Excel workbook to open the customer in my system. I can't make the code work in version 2 and I'm not sure what I'm doing wrong, any help would be greatly appreciated! Unfortunately downloading and using the old version of AFK is not an option for me because my company's anti-virus blocks it.

My old code that worked:

Code: Select all

^numpad5::
Clipboard:=""
SendInput, ^c
ClipWait, 1
Run, https://app.hubspot.com/contacts/1234567/contact/%clipboard%
return

The new code that is not working:

Code: Select all

^numpad5::
{
A_Clipboard:=""
SendInput "^c"
ClipWait 1
Run "https://app.hubspot.com/contacts/1234567/record/0-1/%A_Clipboard%"
}
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
User avatar
WarlordAkamu67
Posts: 232
Joined: 21 Mar 2023, 06:52

Re: Help with V2 %clipboard%  Topic is solved

23 May 2024, 08:29

Hello, try:

Code: Select all

^numpad5::
{
A_Clipboard:=""
SendInput "^c"
ClipWait 1
Run "https://app.hubspot.com/contacts/1234567/record/0-1/" A_Clipboard
}
The variable "A_Clipboard" should not be quoted and "%" are not needed.
Spango911
Posts: 2
Joined: 23 May 2024, 08:08

Re: Help with V2 %clipboard%

23 May 2024, 08:34

THANK YOU @WarlordAkamu67! That worked perfectly. I googled for so dang long to no avail and you have it fixed minutes after I post.
User avatar
boiler
Posts: 17391
Joined: 21 Dec 2014, 02:44

Re: Help with V2 %clipboard%

23 May 2024, 11:00

Spango911 wrote: I googled for so dang long to no avail and you have it fixed minutes after I post.
Typically, as in this case, consulting the official AHK documentation is much more efficient and accurate than googling. In this case, you would want to read and understand the syntax for expressions, which will serve you in almost everything you do with AHK, not just this particular case.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: songdg, Soren and 41 guests