Opening latest document

Discuss RoboTask here
Post Reply
Jabberwock
Posts: 6
Joined: Sat Sep 29, 2007 7:19 am

Opening latest document

Post 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?
Jabberwock
Posts: 6
Joined: Sat Sep 29, 2007 7:19 am

Opening latest document

Post 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"
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Opening latest document

Post by Oleg »

Good solution :)

Also you can solve this problem without basic script. See this example

This task have the same algorithm
Jabberwock
Posts: 6
Joined: Sat Sep 29, 2007 7:19 am

Opening latest document

Post by Jabberwock »

Very interesting! Shows that I have to study the examples deeper...
Post Reply