simply pass a filename to a command?

Discuss RoboTask here
Post Reply
kenwshmt
Posts: 1
Joined: Fri Nov 09, 2007 12:34 pm

simply pass a filename to a command?

Post by kenwshmt »

Whats the easiest way to pass the file name and path to a program?- file changes, move file to someplace else so it wont trigger again.pass that path to a program or batch for processing.as in-path1/pic.jpgmove(or rename) to path2/pic.jpgjpegoptim path2/pic.jpgetc.having it all happen in the GUI would be best.passing arguments to a batch would also work.I just hadn't been able to figure out how to do it with robotask.
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

simply pass a filename to a command?

Post by Oleg »

You can easily determine the name of file in the File loop (for example)
Next, you need to move file to another folder.

Your task will looks so:

File loop //and save current file name to C_FileName variable (for example)
   move {c_FileName} to c:\path2
end loop


If you need to know new full file name do concatenation the ne path and original file name.
There is {ExtractFileName()} variable in order to extract file name fron full path of the file.

Just use
c:\path2\{ExtractFileName({c_FileName})}

Also see other system variables: menu Options | Variables
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

simply pass a filename to a command?

Post by Oleg »

Thus your task will be such:

File loop //and save current file name to C_FileName variable (for example)
   move {c_FileName} to c:\path2
   run program jpegoptim c:\path2\{ExtractFileName({c_FileName})}
end loop
Post Reply