How to monitor a folder, when a new file is created, the file is double-click, then deleted.
I know this should be very simple...
Thanks
simple task-monitor & click ?
simple task-monitor & click ?
Hi,This is a simple example.It is supposed that your new file come into c:\pubThe script is executed each five seconds.First it make a list of current file that are located in c:\pubThe result of that is another file called c:\pub\temp. for each name in temp file, notepad is called with the filename.After that the file is deleted and the temp file is deleted to.start the script and to test it invoke a dos command prompt and go into the directory pub like this:cd \pubnow create a file into the directory like this:dir > text.txtrobotask will automatically open the file test.txt with notepad.exeHere is the script: ( use import command from robotask to read it)Hope this can help you,-Mikronos.;**********************;* RoboTask Task file *;* Do not edit! *;********************** [Root]ActionAfterRun=INTEGER|0Actions=FOLDERAutomat=INTEGER|0CatID=INTEGER|385352816ContinueOnError=INTEGER|0Events=FOLDERExternalName=STRING|"Task10"Hide=INTEGER|0ID=INTEGER|338360479Name=STRING|"Check for new file edit and clear it"Priority=INTEGER|3RunOnClose=INTEGER|0RunOnStartup=INTEGER|0ToLog=INTEGER|3[Actions]Action1=FOLDERAction2=FOLDERAction3=FOLDERAction4=FOLDERAction5=FOLDERAction6=FOLDERAction7=FOLDER[Actions\Action1]ActionID=STRING|"A_FILE_SEARCH"Enabled=INTEGER|-1Name=STRING|"Create File List (c:\pub\temp)"Params=FOLDER[Actions\Action1\Params]After=STRING|"0"aftercount=STRING|"0"AfterLine=STRING|"0"Before=STRING|"0"beforecount=STRING|"0"BeforeLine=STRING|"0"createmode=STRING|"1"date1=STRING|"20061104"date2=STRING|"20061104"destfile=STRING|"c:\pub\temp"DuringDays=STRING|"1"DuringMonths=STRING|"1"file0=STRING|"C:\pub\*.*"filecount=STRING|"1"OlderDays=STRING|"1"OlderMonths=STRING|"1"searchkind=STRING|"0"subdirs=STRING|"1"WithoutPath=STRING|"0"[Actions\Action2]ActionID=STRING|"A_LOOP_TEXT"Enabled=INTEGER|-1Name=STRING|"Text Loop"Params=FOLDER[Actions\Action2\Params]destvar=STRING|"{NAME}"file=STRING|"c:\pub\temp"linecount=STRING|"0"sourcetext=STRING|"0"[Actions\Action3]ActionID=STRING|"A_GENERAL_RUN_PROG"Enabled=INTEGER|-1Name=STRING|"Run ""NOTEPAD.EXE"""Params=FOLDER[Actions\Action3\Params]params=STRING|"{name}"program=STRING|"NOTEPAD.EXE"runas=STRING|"0"wait=STRING|"0"[Actions\Action4]ActionID=STRING|"A_GENERAL_PAUSE"Enabled=INTEGER|-1Name=STRING|"Delay 1000 ms"Params=FOLDER[Actions\Action4\Params]delay=STRING|"10"[Actions\Action5]ActionID=STRING|"A_FILE_DELETE"Enabled=INTEGER|-1Name=STRING|"Delete File"Params=FOLDER[Actions\Action5\Params]Count=STRING|"1"deletedirs=STRING|"0"file0=STRING|"{name}"subdir=STRING|"0"ToRecycleBin=STRING|"1"[Actions\Action6]ActionID=STRING|"A_LOOP_END"Enabled=INTEGER|-1Name=STRING|"End Loop"[Actions\Action7]ActionID=STRING|"A_FILE_DELETE"Enabled=INTEGER|-1Name=STRING|"Delete File"Params=FOLDER[Actions\Action7\Params]Count=STRING|"1"deletedirs=STRING|"0"file0=STRING|"c:\pub\temp"subdir=STRING|"0"ToRecycleBin=STRING|"1"[Events]Event1=FOLDER[Events\Event1]Enabled=INTEGER|-1EventID=STRING|"E_GENERAL_CYCLIC"Params=FOLDER[Events\Event1\Params]id=STRING|"3969173H"interval=STRING|"5"
simple task-monitor & click ?
This task have sense only for text files.
You can use in "Program or Document name" parameter the {name}.
If there is any program associated with document then system will start the default program for the file.
You can use in "Program or Document name" parameter the {name}.
If there is any program associated with document then system will start the default program for the file.
simple task-monitor & click ?
Thanks Oleg for the tip, I havent this that!!-Mikronos.
-
- Posts: 5
- Joined: Sat Nov 04, 2006 5:58 am
simple task-monitor & click ?
Oleg wrote:This task have sense only for text files.
You can use in "Program or Document name" parameter the {name}.
If there is any program associated with document then system will start the default program for the file.
Thanks for your help. Indeed I use 'window(folder option)' with "file types: Open with" ...then the program. But I still can't get it to work... what would be the correct dialog for this task:
1)monitor folder c:\input
2)when a file is created, double-click it.
3)wait 10 sec
4)delete the file
Thanks again!
simple task-monitor & click ?
Double-clicking on the file equals to "run file with default program".
You can do this if you specify name of file in "Program or Document name" parameter in "Run program/Open document" action. As for the rest the task will be similar as wtote mikronos (see above).
You can do this if you specify name of file in "Program or Document name" parameter in "Run program/Open document" action. As for the rest the task will be similar as wtote mikronos (see above).