1) NAOPAG - NAO Pag!!! OK made it up, but still "Not All On-line Persons are guys..."
2) I'm not too familiar with batch file commands, but I think this is what you are doing.
It looks like you are looping through all .gpl files and doing something.
This will loop through all .gpl files in the working directory (and subfolders)
Code:
Loop, *.gpl, 0, 1
{
;Do Something
}
Now for the "Do Something".
It looks like you are running "gpsbabel.exe" with parameter "-t -i gpl -f <File> -x position,distance=25f -o gpl -F <File>" where <File> is the current file.
This would be
Code:
;Declared Outside of loop
GPSBabel := "gpsbabel.exe"
;Declared In loop
CurrentFile = %A_LoopFileFullPath%\%A_LoopFileName%
arguments = -t -i gpl -f %CurrentFile% -x position,distance=25f -o gpl -F %CurrentFile%
RunWait, %GPSBabel% %arguments%
Then, combine them (and add the option to selecet working path) and you get
Code:
;Specify "" for ThisDirectory to use A_WorkingDir as the working directory
;must contain trailing backslash if directory(i.e C:\) to work as expected
ThisDirectory := ""
;Path for GPSBabel
GPSBabel := "gpsbabel.exe"
Loop, %ThisDirectory%*.gpl, 0, 1
{
CurrentFile = %A_LoopFileFullPath%
arguments = -t -i gpl -f %CurrentFile% -x position,distance=25f -o gpl -F %CurrentFile%
MsgBox, % CurrentFile . "`nRun: " . GPSBabel . "`nWith arguments: " . arguments
;A_WorkingDir is used as the working directory
;RunWait, %GPSBabel% %arguments%
;remove after you verify that the current file / args are right
break
}
Like all DOS stuff, if you use "\" for the directory it will use the current directory (whatever drive you run the code from). So, "\SomeFolder" would loop through "SomeFolder" on the current drive (in case you need portable use, via flash drive, external drive, CD/DVD, etc.)
Like always, if you have any questions, don't hesitate to ask.
_________________
As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the
Class Library. Check out
my scripts.