RunWait parameters
#1
Posted 05 April 2012 - 08:19 AM
I want to run a program (pdftotext.exe) to process the files of a folder
F1::
Loop, C:\pdf\*.pdf
;A_LoopFileLongPath will contain the name of the file each time loop runs
RunWait, pdftotext.exe, C:\bin32
; I see in the examples and /c what is it?
; how do I add the parameters for pdftotext.exe ? eg output file, etc
thanks!
#2
Posted 05 April 2012 - 10:19 AM
F1:: RunWait Notepad.exe "this is a test file.txt" Msgbox Notepad exited ! Return F2:: File = test.bmp RunWait Mspaint.exe "%File%" Msgbox Mspaint exited ! Return
So :
RunWait FILE.EXE PARAM1 PARAM2 PARAM3If needed enclose the PARAM with " ".
#3
Posted 05 April 2012 - 12:43 PM
RunWait, “pdftotext.exe -f 1 -l 1 -layout 1 1.txt”, E:\pdf\bin32\?
#4
Posted 05 April 2012 - 12:51 PM
Do I kill myself now ???
Do you see "," in my example ?
RunWait pdftotext.exe -f 1 -l 1 -layout 1 "1.txt" "E:\pdf\bin32"
Don't use , and use " only for parameters wich can contain spaces in it "like filename)
A document, URL, executable file (.exe, .com, .bat, etc.), shortcut (.lnk), or system verb to launch (see remarks). If Target is a local file and no path was specified with it, A_WorkingDir will be searched first. If no matching file is found there, the system will search for and launch the file if it is integrated ("known"), e.g. by being contained in one of the PATH folders.
To pass parameters, add them immediately after the program or document name. If a parameter contains spaces, it is safest to enclose it in double quotes (even though it may work without them in some cases).
#5
Posted 05 April 2012 - 01:19 PM
RunWait, “...”...those are "smart quotes"...aka...what I call "dumb quotes" (they won't work for code, but I don't like them anyway)...where did you type your message that caused them?...if it's only a glitch when typing on the forum, it's OK (you should still fix it tho, as it's confusing), but if those "special" quotes are in your real code, you'll have problems...
When you need quotes, use the normal quotes...
RunWait, "..."...& here they are, bigger, for comparison...
Smart Quotes: “ ”
Normal Quotes: " "...remember: smart quotes do not work in code.
#6
Posted 06 April 2012 - 07:35 AM
the original format is this:
In cmd, we type:
pdftotext.exe -f 1 -l 1 -layout <pdf_file_input> <text_file_output>
the exe to be run is a DOS program, so I need the "%comspec% /c" at the begining, but what is /c really? I didnt find any documentation about it
anyway, then, it should be:
RunWait %comspec% /c E:\pdf\bin32\pdftotext.exe -f 1 -l 1 -layout %A_LoopFileLongPath% %A_LoopFileName%.txt
right?
#7
Posted 06 April 2012 - 10:01 AM
open DOS window (cmd) and type cmd /? ( then see help to this DOS-command )need the "%comspec% /c" at the begining, but what is /c really?
/c = close DOS
/k = keep DOS window open when command executed
see also hide (ahk-command)
#8
Posted 08 April 2012 - 10:13 PM
RunWait %comspec% /c E:\pdf\bin32\pdftotext.exe -f 1 -l 1 -layout input.pdf output.txt
it just flashes a cmd window
any hint?
#9
Posted 09 April 2012 - 07:47 AM
RunWait %comspec% /c E:\pdf\bin32\pdftotext.exe -f 1 -l 1 -layout input.pdf output.txt,,hide
#10
Posted 09 April 2012 - 05:35 PM
RunWait %comspec% /c E:\pdf\bin32\pdftotext.exe -f 1 -l 1 -layout input.pdf output.txt,,hide
it simply doesnt work!
any hint?
#11
Posted 09 April 2012 - 05:52 PM
RunWait C:\Program Files\xpdfbin-win-3.03\bin32\pdftotext.exe -f 1 -l 1 -layout input.pdf output.txt,,hide
#12
Posted 09 April 2012 - 08:37 PM
but why it doesnt work in this context?
Loop, C:\Documents and Settings\Administrator\Desktop\New Folder\*.pdf
{
RunWait C:\Documents and Settings\Administrator\Desktop\test\pdftotext.exe -f 1 -l 1 -layout -enc UTF-8 %A_LoopFileLongPath% %A_LoopFileLongPath%.txt,,hide
}
it should generate all *.pdf.txt files inside New Folder
#13
Posted 09 April 2012 - 08:46 PM
That may be what you want, but that is not what you programmed the script to do.it should generate all *.pdf.txt files inside New Folder
WorkingDir
The working directory for the launched item. Do not enclose the name in double quotes even if it contains spaces.
If omitted, the script's own working directory (A_WorkingDir) will be used.
#14
Posted 09 April 2012 - 08:48 PM
Loop, C:\Documents and Settings\Administrator\Desktop\New Folder\*.pdf
{
RunWait "C:\Documents and Settings\Administrator\Desktop\test\pdftotext.exe" -f 1 -l 1 -layout -enc UTF-8 "%A_LoopFileLongPath%" "%A_LoopFileLongPath%.txt",,hide
}
#15
Posted 09 April 2012 - 09:08 PM
Try quotes for filenames :?:
that worked
but after that, the below line did not work:
FileMove, %A_LoopFileLongPath%, %A_LoopFileDir%%SampleID%.pdf
any hint?




