Trying to create a larger subroutine where it tabs a user defined number of times, then presses a given keyboard command (Enter, space, etc)
The issue I'm having is that I can't get any version of the following to work:
Let>userWord=Enter
Press userWord
I've tried with every combination of %userWord%, {%userWord%}, etc I could think of, and tried enabling and disabling explicit variables, and probably a few other things.
I'm guessing that the issue is that "Enter" is basically a system variable or something like that which has a given meaning, and this is causing it to be interpreted in ways I didn't intend. Is there any way to allow "Enter" (or the other things like "Space" that I might want at the end of the subroutine) to be allowed as a user input and processed as I intend here?
I know I could just use other ways of doing it... like user enters "e", and subroutine says IF>input=e, then Press Enter... but I'm interested in the answer anyway.
Can't Press %var% where var=Enter
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Can't Press %var% where var=Enter
See:
https://www.mjtnet.com/manual/press.htm
You need to set PRESS_ALLOWVARS to 1:
https://www.mjtnet.com/manual/press.htm
You need to set PRESS_ALLOWVARS to 1:
Code: Select all
Let>PRESS_ALLOWVARS=1
Let>theKey={"Enter"}
Press %theKey%
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?