IfNotExist pause

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sttrebo
Posts: 68
Joined: 27 Jan 2014, 12:31

IfNotExist pause

30 Jan 2018, 16:06

having a problem with a short piece of code. all it needs to do is check for the existence (or not) of a file then execute something. since the script is run over a network there is some delay in getting the response from the remote machine.

here is the code:

Code: Select all

IfNotExist, %A_Temp%\AHK.txt
	{
	sleep, 5000
	DriveGet, List, List, Fixed
	Loop Parse, List
		Loop %A_LoopField%:\_DropBox_Location.,1,1
		DB_Path := A_LoopFileDir
	}
msgbox, %db_path%
IniWrite, %DB_Path%, %A_Temp%\AHK.txt, DropBox, Location

IniRead, DB_Path, %A_Temp%\AHK.txt, DropBox, Location
IniRead, Mach_Name, %A_Temp%\AHK.txt, Machine, Name
startup_file = AHK Startup - %Mach_Name%.ahk
msgbox, %db_path%\AHK\%startup_file%
exitapp
no matter what i try, i cannot get it to wait for a response for the first line (ifnotexist, .....). also, when i add a sleep command as the first line under the first {, the sleep command seems to be ignored). any ideas?
sttrebo
Posts: 68
Joined: 27 Jan 2014, 12:31

Re: IfNotExist pause

31 Jan 2018, 12:09

oops, nevermind. found the problem with the script. dumb mistake, i needed to move the iniwrite line into the loop parse sequence. old age sucks sometimes...
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: IfNotExist pause

31 Jan 2018, 12:18

You are also missing brackets around your loop block, don't know if you caught that as well.
sttrebo
Posts: 68
Joined: 27 Jan 2014, 12:31

Re: IfNotExist pause

31 Jan 2018, 12:33

yes, caught that when i moved the iniwrite statement. but thanks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 243 guests