Script will only run the first two run items and nothing else

Get help with using AutoHotkey and its commands and hotkeys
MindOfSilicon
Posts: 3
Joined: 29 Dec 2017, 06:09

Script will only run the first two run items and nothing else

29 Dec 2017, 06:21

I am having an issue where a script will only run the first two run items and nothing else.
For example for a script to reload scripts.

#F9::
run, "C:\Drive\AHK\phrases.ahk"
run, "C:\Drive\AHK\macro.ahk"
run, "C:\Drive\AHK\autocorrect.ahk"
run http://www.google.com/
return

Only the first two items will run.

Thank you and sorry for any inconvenience.
BoBo
Posts: 3761
Joined: 13 May 2014, 17:15

Re: Script will only run the first two run items and nothing else

29 Dec 2017, 07:06

Try if each and every one of them will run separately. How much of AHK's tray icons are displayed once you trigger the hotkey?
nadjibSoft
Posts: 9
Joined: 29 Dec 2017, 14:57
Facebook: 100011403841640

Re: Script will only run the first two run items and nothing else

29 Dec 2017, 15:35

you may be run other programs from the script "autocorrect.ahk"
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Script will only run the first two run items and nothing else

30 Dec 2017, 09:17

Try adding some Sleep lines.

Code: Select all

#F9::
run, "C:\Drive\AHK\phrases.ahk"
Sleep, 200
run, "C:\Drive\AHK\macro.ahk"
Sleep, 200
run, "C:\Drive\AHK\autocorrect.ahk"
Sleep, 200
run http://www.google.com/
return
I use Run to open tabs in Internet Explorer, I'm currently using a Sleep of 400 ms, if I don't, some tabs seem to not get opened, or, seem to open in the wrong order. Cheers.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
MindOfSilicon
Posts: 3
Joined: 29 Dec 2017, 06:09

Re: Script will only run the first two run items and nothing else

31 Dec 2017, 14:23

I was an idiot, the script was rerunning itself, which canceled subsequent actions.
Moving run, "C:\Drive\AHK\macro.ahk" to the end of the task list solves the problem.
User avatar
KuroiLight
Posts: 327
Joined: 12 Apr 2015, 20:24
GitHub: KuroiLight

Re: Script will only run the first two run items and nothing else

31 Dec 2017, 14:47

Reload will accomplish the same.
Windows 10, Ryzen 1600, 16GB G.Skill DDR4, 8GB RX 480 | [MyScripts][MySublimeSettings] [Unlicense][MIT License]
01/24/18
[/color]

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], Lem2001, marc873a, Visioneer and 37 guests