Hi,
I would like to make a macro with a single keyboard shortcut to run various macros.
The intention is to have 2 options and every time start a different macro.
And there was another option that is intended to run a macro or another depending on if you press once or if you press twice.
Can anyone help me?
Thank you very much
Toogle Shortcut - launch macros
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I'm not entirely sure I understand what you want to do. Perhaps you could clarify.
You can assign a hot key to a macro and then have that macro ask the user for information or make some decision based on some other context (e.g. which window is currently active) and then run a different macro or subroutine. So certainly you can have one hot key do different things depending on context or input.
But for more specifics perhaps you can clarify precisely what you want and we'll try to help.
You can assign a hot key to a macro and then have that macro ask the user for information or make some decision based on some other context (e.g. which window is currently active) and then run a different macro or subroutine. So certainly you can have one hot key do different things depending on context or input.
But for more specifics perhaps you can clarify precisely what you want and we'll try to help.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi, sorry for my english.
I'll try to explain better.
They are two different macros:
macro 1
-Press once a shortcut, it displays the message 1.
-Press twice consecutive a shortcut, display message 2.
macro 2
-Press once a shortcut, it displays the message 1.
Saves the state in a register.
After a few seconds...
I'll be back, press once shortcut, displays message 2.
Thanks!
I'll try to explain better.
They are two different macros:
macro 1
-Press once a shortcut, it displays the message 1.
-Press twice consecutive a shortcut, display message 2.
macro 2
-Press once a shortcut, it displays the message 1.
Saves the state in a register.
After a few seconds...
I'll be back, press once shortcut, displays message 2.
Thanks!
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
Javier, one way to do the second scenario, is write to an INI file
When script launches, use some logic similar to this...
When script launches, use some logic similar to this...
Code: Select all
IfFileExists
ReadIniFile for LastMessage
Else
Use WriteLn to create INI file with Message1 (or some flag to indicate Message1)
Set LastMessage = Message1
Endif
If LastMessage = Message1
Show Message2
EditIniFile to Message2
Else
Show Messge1
EditIniFile to Message1
Endif