Page 1 of 1
Opening latest document
Posted: Sat Sep 29, 2007 7:24 am
by Jabberwock
The task I am planning requires opening of a latest document in a specific folder. Can I do that in RoboTask?If not, can I use a script output (e.g. PERL) as a variable?
Opening latest document
Posted: Sat Sep 29, 2007 12:00 pm
by Jabberwock
Did with an external script...VBS script:Set aFSO = CreateObject("Scripting.FileSystemObject")Set aFolder = aFSO.GetFolder("C:\MyPath")Set aFiles = aFolder.FilesFor Each aFile In aFiles If aFSO.GetExtensionName(aFile.Name) = "dvprj" And aFile.DateLastModified > LatestDate Then LatestDate = aFile.DateLastModified LatestFile = afile.Path End IfNextSet outFile = aFSO.CreateTextFile("C:\MyPath\latest.txt", 1)outFile.Write (LatestFile)RoboTask:;**********************;* RoboTask Task file *;* Do not edit! *;********************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|-1CatID=INTEGER|0ContinueOnError=INTEGER|0ExternalName=STRING|"Task3"Hide=INTEGER|0ID=INTEGER|1120799126Name=STRING|"RunLast"Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3[Actions]Action1=FOLDERAction2=FOLDER[Actions\Action1]ActionID=STRING|"A_GENERAL_RUN_PROG"Enabled=INTEGER|-1Name=STRING|"Run ""LastModified.vbs"""Params=FOLDER[Actions\Action1\Params]program=STRING|"C:\MyPath\LastModified.vbs"runas=STRING|"1"wait=STRING|"2"[Actions\Action2]ActionID=STRING|"A_GENERAL_RUN_PROG"Enabled=INTEGER|-1Name=STRING|"Run ""latest.txt)}"""Params=FOLDER[Actions\Action2\Params]program=STRING|"{TextFile(C:\MyPath\latest.txt)}"runas=STRING|"0"wait=STRING|"0"
Opening latest document
Posted: Tue Oct 16, 2007 12:59 am
by Oleg
Good solution
Also you can solve this problem without basic script. See this example
This task have the same algorithm
Opening latest document
Posted: Tue Oct 16, 2007 1:54 am
by Jabberwock
Very interesting! Shows that I have to study the examples deeper...