sub script no working

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jdfnnl
Posts: 14
Joined: 10 Mar 2022, 01:21

sub script no working

06 May 2024, 01:33

Can anyone say why this script placed at the bottom of a master script does not operate?

Code: Select all

#s::
send, ^c
sleep 200
run, http://www.google.com/search?q=%clipboard%
return
User avatar
boiler
Posts: 17180
Joined: 21 Dec 2014, 02:44

Re: sub script no working

06 May 2024, 02:24

I’m guessing it’s because you have some type of #If directive earlier in the script, preventing this hotkey from being active when you want it to be. Try putting just #If on a line above the #s:: line to prevent any prior directive from affecting this hotkey.

It’s also better to use ClipWait rather than Sleep:

Code: Select all

#If
#s::
Clipboard := ""
send, ^c
ClipWait, 1
if ErrorLevel
	return
run, http://www.google.com/search?q=%clipboard%
return
Rohwedder
Posts: 7706
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: sub script no working

06 May 2024, 02:30

Hallo,
try:

Code: Select all

#s up::
send,% (ClipBoard:="") "^c"
ClipWait, 0
run, http://www.google.com/search?q=%clipboard%
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, Google [Bot] and 85 guests