Launching a Macro Using OnEvent

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ADP_MAN
Junior Coder
Posts: 45
Joined: Wed Apr 07, 2004 2:04 pm

Launching a Macro Using OnEvent

Post by ADP_MAN » Thu Apr 30, 2015 3:34 pm

Hi All,

I have only launched a macroscheduler macro from clicking on a job inside a program. In this instance I would like MS to watch a folder, then run a job when a file is detected. A few questions:

How can I have MS "on" all the time? In other words, if the machine I want this job on has been restarted, will I need to turn the macro back" on" somewhere for it to start watching the folder again, or is it always "on" once created?

What command would I use to get the macro to run. I assume I would use "OnEvent>FILE_EXISTS". Is that right? If anyone has a sample script or would like to provide some input, I would appreciate the help.

Thanks!
Dom

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

Re: Launching a Macro Using OnEvent

Post by Marcus Tettmar » Fri May 01, 2015 1:23 pm

Macro Scheduler is usually set to run on startup. If not you can put a shortcut in your Startup folder. You can then use a Trigger (See the Triggers tab under Macro Properties) to respond to a new file in a folder and run your macro.

However, if you are wanting to compile a macro to a .exe then, yes, this .exe would need to be started before it can do anything. So you could do similarly and set the .exe to run on startup via a Startup shortcut.

And then you could have a loop within that macro which uses e.g. GetFileList and when the file count increases it does something. Make it loop back afterwards so that it is continuously running and checking.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

ADP_MAN
Junior Coder
Posts: 45
Joined: Wed Apr 07, 2004 2:04 pm

Re: Launching a Macro Using OnEvent

Post by ADP_MAN » Mon May 04, 2015 7:01 pm

Thanks for the help! I have it up and running.

Dom

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