Opening latest document
-
- Posts: 6
- Joined: Sat Sep 29, 2007 7:19 am
Opening latest document
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?
-
- Posts: 6
- Joined: Sat Sep 29, 2007 7:19 am
Opening latest document
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
Good solution 
Also you can solve this problem without basic script. See this example
This task have the same algorithm

Also you can solve this problem without basic script. See this example
This task have the same algorithm
-
- Posts: 6
- Joined: Sat Sep 29, 2007 7:19 am
Opening latest document
Very interesting! Shows that I have to study the examples deeper...