Can't Press %var% where var=Enter

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Warren
Pro Scripter
Posts: 83
Joined: Sun Oct 08, 2017 11:57 pm

Can't Press %var% where var=Enter

Post by Warren » Sat Oct 21, 2017 10:01 pm

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.

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

Re: Can't Press %var% where var=Enter

Post by Marcus Tettmar » Sun Oct 22, 2017 9:03 am

See:
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?

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