I'm here to ask for suggestion, right now I've written a script to:
1. open an application,
2. import a file & do some manipulation on that file.
And I've a folder containing alot of files, I want to iterate through this folder and pickup 1 file at a time & send this file name to the above mentioned ahk script.
Approach 1: Write a python script looping through the folder & passing filename as a variable to that script.
Approach 2: Writing another ahk script looping through the folder & passing filename as a variable to that script.
Approach 3: Editing the present ahk script to add a loop at the top & then putting all the commands within the scope of that loop.
FYI, I'm a python developer trying my hands on ahk for the first time, please suggest something!
Looping through a folder & passing filename as a variable
Re: Looping through a folder & passing filename as a variable
I would do #3 just to keep everything together. However, if your script is robust you could do #2 and do your file manipulations in parallel.
Re: Looping through a folder & passing filename as a variable
Agree with colt. Use Loop, Files and the A_LoopFileFullPath built-in variable.
Re: Looping through a folder & passing filename as a variable
Okay so for a loop in ahk, I'm supposed to use {} or indentation to put code within the loop?
Sorry if I'm being too noob.
Sorry if I'm being too noob.
Re: Looping through a folder & passing filename as a variable
With AHK, indentation is for visualization only. Use { } to identify code blocks as you described. An exception is if the loop only contains one line following the loop statement, then no { } are necessary.
See {…} (block) for more details on this.
See {…} (block) for more details on this.
Re: Looping through a folder & passing filename as a variable
Thanks man, really appreciate your help, will try it out & see how it goes!
Who is online
Users browsing this forum: Auntiejack56, JoeWinograd, Xtra and 148 guests