View Full Version : Triggers
noroom
11-18-2006, 02:24 PM
Could you add an option to auto execute a macro when a certain file appears in a folder?
For example, I could make a macro that uploads a file to an FTP server as soon as it's finished downloading on my computer.
Carlos
11-23-2006, 10:23 AM
I think you can try "If statement>Folder content changes"...
noroom
11-23-2006, 08:41 PM
Yeah, that does half of what I want... I need a way to check if a file exists.
This is what I want to do:
- Monitor a folder for changes
- When a change is detected see if file "test.txt" exists
- If it does, execute macro.
Can you help me with that?
Carlos
11-27-2006, 01:18 PM
Can you try build 766?
http://www.closetosoftware.com/temp/mr4b766.zip
Remember that the %newfileinfolder% tag means just the filename (e.g. test.txt) not the file full path.
noroom
11-28-2006, 08:56 PM
I'm confused. I can use %newfileinfolder% in the Run file option, but not in the if-statement option.
I want to see if file "test.txt" exists, because I want my macro to run as soon as the file is created in that folder. How can I do this using your program. Could you write a macro for me that does it? I think with the current Macro Runner (even the new build) this can't be done.
Carlos
11-29-2006, 09:04 AM
What can be done right now (let me know if it's ok for you or I'll add another "If" feature like "If file exists"):
First item: "If statement>Folder content changes" and select the folder
Second item: the second item will run after the folder content changes (e.g. a file was created) and the %newfileinfolder% tag is the filename; with the folder your're watching (e.g. "C:\Temp\") plus the filename that was created you can add an item to copy that file in another folder or send it via FTP. Give a 4 sec delay for the second macro item.
This kind of procedure is useful when you don't know the filename that'll be created in a watched folder. If you do know the name then maybe the "if file exists" can be useful.
noroom
11-30-2006, 07:36 PM
The thing is, I know the name. And I want the program doing different things depending on the name of the file. That's why I need a "if file exists". :)
If you could add that, that would be great!
And how do you monitor a folder? With a timer? Or is there a Windows API?
Carlos
11-30-2006, 07:59 PM
Ok! When I have time I'll add the "If file exists".
MR uses Windows API to keep track of folder content changes.
noroom
12-03-2006, 07:46 PM
Awesome. Timers are annoying. :P
Looking forward to the update!
Carlos
01-07-2007, 09:40 PM
Closed!
Thanks noroom for testing MR 5. :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.