Jump to content
Macro Express Forums

Run macros on program start and finish?


terrypin
 Share

Recommended Posts

Could someone please advise how I can construct a macro which will start program X when I first start program A, and start program Y when I close program A?

 

(For background, this is to let me start the driver for my new toy, a sort of joystick thingie that lets me navigate more easily in Google Earth. I've noticed that it consumes 4-5% of CPU even when I'm not using it, so I'd like it to run only when Google Earth is running. It came with two utilities, to start and stop the driver, so those are X and Y, and Google Earth is A.)

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

:rolleyes:I'm looking to do about the same. But I want to use a hot key to open a prorgam (If it's not already open). So it would be like a TOGGLE. IF IT'S OPEN IT WOULD THEN CLOSE. IF it's closed it would open.

 

Very basic. I hope with both get some help.

 

Bob

 

That sounds different to my requirement, Bob, and I'd have thought fairly easy. Can't you just make the first step of your macro (started by the hotkey) to test whether Program X is running. If it is, close it (send keys to it to do so). If it's not, open it (launch it).

 

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I am pretty sure i can answer both of your questions.

Terry, I'm not sure if what you want to do is better than just having that driver running. The way i would do it would have the macro constenly searching for that program. I envison bad things happening then.

 

as for the Toggle key. This is simple. In MacroExpress you'll create a new macro and set a Hot-key, like Win+F2.

 

I indcluded the code you can take a look at but basically i did this.

 

If Program not running "program.exe" Run macro "startprogram"

If program running "program.exe" Run Macro "stopprogram"

 

Simple eh?

 

 

 

<IFOTH:14:1:EXPLORER.EXE><MACRUN2:Runprogram><ENDIF><IFOTH:06:1:EXPLORER.EXE><MACRUN2:StopProgram><ENDIF>

Link to comment
Share on other sites

Thanks kahamri. On reflection, you're right about having to keep it runing permanently - not satisfactory.

 

The reason I hesitate to keep the driver running permanently is that it consumes about 3-4% CPU constantly. Also, its blue LEDs are not only a small waste of power but they constantly distract and tempt me to open Google Earth!

;)

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...