Trigger Program on Certain Occasions

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Trigger Program on Certain Occasions

Post by winstein » Thu Dec 03, 2015 9:08 am

The script in which I will compile into a program will need to be run when a new file is added to a folder. Is there a way to do this?

To put it this way, I want to run the program so that as soon as one file is generated, the existence of that file will in turn make this executable work.

Thanks for reading.
PPQ

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Trigger Program on Certain Occasions

Post by Marcus Tettmar » Fri Dec 04, 2015 4:26 pm

If this is to be compiled you'd need to make a loop which checks for the existence of the file and act accordingly, then make it loop over again. And then you'd need to start the compiled macro (the .exe) and leave it running continuously.

Your code would be something like:

Code: Select all

Label>start
IfFileExists>filename
  //do something
Endif
Wait>0.2
Goto>start
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts