Open all PDF files in folder and subfoldr

Discuss RoboTask here
Post Reply
jmarinov
Posts: 4
Joined: Mon Oct 20, 2008 8:54 am
Location: United States

Open all PDF files in folder and subfoldr

Post by jmarinov »

This is probably a very trivial task judging from all other postings.I am trying to create an algorithm which opens consecutively all PDF files in a directory and its subdirectories. In case of multiple files - it opens one file, logs its result (success or fail) and then closes and proceeds to next. After it is done with all files it generates a text file log with results.I can open one file only - can't quite make it search all files and open and then finally stop the job and print.Any help?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Open all PDF files in folder and subfoldr

Post by Oleg »

Use the file loop please.
Algorithm is such:

File loop by c:\myFolder\*.pdf
   Open the current PDF
   ...Do something else
   Write text file // new string to your log
end loop
Open your text file
jmarinov
Posts: 4
Joined: Mon Oct 20, 2008 8:54 am
Location: United States

Open all PDF files in folder and subfoldr

Post by jmarinov »

Ok I can't really get it to pass new string/file information to the log,how can you have it grab the actual file name and post it in the log?See what I've done so far with the help of examples - I am writing a text string but it is really not a report of what was successfully opened so far.*****************************;* RoboTask Task file         ;* Do not edit in text editor!;***************************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|-1CatID=INTEGER|2091259954ContinueOnError=INTEGER|0ExternalName=STRING|"tasklog"Hide=INTEGER|0ID=INTEGER|1271818381Name=STRING|"Run each EXE and wait for exit (imported)"Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3WriteGeneralLog=INTEGER|0[Actions]Action1=FOLDERAction2=FOLDERAction3=FOLDERAction4=FOLDERAction5=FOLDERAction6=FOLDERAction7=FOLDER[Actions\Action1]ActionID=STRING|"A_LOOP_FILE"Enabled=INTEGER|-1Name=STRING|"File Loop"Params=FOLDER[Actions\Action1\Params]createmode=STRING|"1"date1=STRING|"20080928"date2=STRING|"20080928"destvar=STRING|"FRET"DuringDays=STRING|"1"DuringMonths=STRING|"1"file0=STRING|"C:\temp\PDF\*.pdf"filecount=STRING|"1"OlderDays=STRING|"1"OlderMonths=STRING|"1"savesize=STRING|"0"searchkind=STRING|"0"subdirs=STRING|"1"timesize=STRING|"0"WithoutPath=STRING|"0"[Actions\Action2]ActionID=STRING|"A_GENERAL_RUN_PROG"Enabled=INTEGER|-1Name=STRING|"Run ""{FRET} """Params=FOLDER[Actions\Action2\Params]program=STRING|"{FRET}"runas=STRING|"3"wait=STRING|"0"[Actions\Action3]ActionID=STRING|"A_GENERAL_PAUSE"Enabled=INTEGER|-1Name=STRING|"Delay 500 ms"Params=FOLDER[Actions\Action3\Params]delay=STRING|"5"[Actions\Action4]ActionID=STRING|"A_GENERAL_SENDKEYS"Enabled=INTEGER|-1Name=STRING|"Send keys to active window"Params=FOLDER[Actions\Action4\Params]currentwindow=STRING|"1"fixedwindow=STRING|"1"keylayout=STRING|"67699721"keys=STRING|"{ENTER}"sendkind=STRING|"0"wincaption=STRING|"Open File - Security Warning"[Actions\Action5]ActionID=STRING|"A_WAITFORPROCESS"Enabled=INTEGER|-1Name=STRING|"Wait for ""{FRET}"" (120 sec.)"Params=FOLDER[Actions\Action5\Params]assign=STRING|"0"infinity=STRING|"0"more=STRING|"0"process=STRING|"{FRET}"timeout=STRING|"120"[Actions\Action6]ActionID=STRING|"A_FILE_TEXTWRITE"Enabled=INTEGER|-1Name=STRING|"Create text file C:\Documents and Settings\robolog.txt"Params=FOLDER[Actions\Action6\Params]fileexists=STRING|"1"filname=STRING|"C:\Documents and Settings\robolog.txt"line0=STRING|"pdf file created"linecount=STRING|"1"[Actions\Action7]ActionID=STRING|"A_LOOP_END"Enabled=INTEGER|-1Name=STRING|"End Loop"
Last edited by jmarinov on Mon Oct 20, 2008 2:14 pm, edited 1 time in total.
jmarinov
Posts: 4
Joined: Mon Oct 20, 2008 8:54 am
Location: United States

Open all PDF files in folder and subfoldr

Post by jmarinov »

Nevermind I got it - I figured I was already passing the file name to a variable and grabbed that variable and threw it into the text file.One minor glitch. Adobe only opens 50 files at a time.Is there a quick function I can use to close all PDFs periodically -or better yet, close each PDF after its opened.
Post Reply