Press SPACEBAR

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Press SPACEBAR

Post by armsys » Thu May 29, 2003 4:11 am

Is there a command: Press SPACEBAR or something like that? I looked up the whole online guide but can't find a cue. Any suggestion? Thanks.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu May 29, 2003 4:40 am

Hi Armstrong.....

No there is no Press Spacebar command. Just press the spacebar!

Turn on Edit, Show all characters to see the result.

PS, this does not provide for separate Press and Release Spacebar, only enters a space.

I am sure you already knew this and forgot about it...right?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Mayhem
Junior Coder
Posts: 25
Joined: Tue Apr 22, 2003 6:34 pm

Post by Mayhem » Thu May 29, 2003 8:16 pm

The press/release spacebar would come in handy.

Maybe they will consider including that in their next release.

Kenneth Jensen
Mobile Computer Service

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Thu May 29, 2003 11:27 pm

Hi Bob,

Thanks for your very kind help. I edit all Macro scripts with Multi-Edit 9, which truncatea all trailing spaces automatically. Perhaps next time I'll use Macro Scheduler's editor to handle the situation as you suggest. To circumvent the missing PRESS SPACEBAR issue, I change my coding as follows:

Let>Date1=01/31/2003
Let>Date2=06/01/2003
Sen>%Date1% and %Date2%

Originally, I wrote the following unsupported script:
Sen>date1
Press SPACEBAR
Sen>and
Press SPACEBAR
Sen>date2

Thanks for sharing your scripting insight.

Mayhem,

After months of frantic scripting in Macro Scheduler, I had never discovered the missing PRESS SPACEBAR until yesterday. For the purpose of completeness of a macro languague, I feel strongly the PRESS SPACEBAR should be included.

Happy scripting.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri May 30, 2003 12:08 am

Hello Armstrong........you mentioned:
I edit all Macro scripts with Multi-Edit 9
I knew there was a good reason you were asking. :!:

And I see that your final "normal" solution is only one line of code, vs. the original five lines. So this actually turns out to be easier. But how will you remember this in ME? I see that as your long term problem.

Re the need for PRESS SPACEBAR:
Why is there a need for that? I could follow the logic to a conclusion that there should be a PRESS A, PRESS B, PRESS 6, PRESS ?, PRESS ~, etc. And we shouldn't forget the RELEASE versions of all of those keys.

I think the SPACEBAR is and should be treated as any other alpha-numeric symbol even though it is visible. Its only purpose is as a string separator or delimiter like the period, comma, semicolon, etc.

The reason that some other keys have a PRESS and RELEASE is because they can alter the function of other keys. Note that there is no RELEASE for HOME, END, PAGEUP, DEL, etc. These keys, like SPACEBAR, do not functionally change the value of the following key. They only have a PRESS because they are functions unto themselves, and are not used in strings.

It looks to me like MJT is being very consistent in the decision to have a PRESS/RELEASE command.

Those are some of my thoughts, but to support you and Mayhem and others who think differently, I guess it wouldn't hurt to have PRESS/RELEASE SPACEBAR added so that you can edit in a different product (Multi Edit).

Let's see what MJT decides to do. Enjoy............:D
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri May 30, 2003 12:56 am

Hello Bob,
Why is there a need for that? I could follow the logic to a conclusion that there should be a PRESS A, PRESS B, PRESS 6, PRESS ?, PRESS ~, etc. And we shouldn't forget the RELEASE versions of all of those keys.
Very excellent question! It's because none of your suggested alphanumeric characters are of a white space (in accordance with the definition of Regular Expressions). Thus, it can't be treated as alphanumeric symbol per your suggestion.

Of course, PRESS SPACEBAR doesn't require a matching RELEASE SPACEBAR, the latter doesn't make any sense programmatically.

Alternatively, MJT may create a system variable, say SYS_SP, to store ASCII 32 (space). Nonetheless, PRESS SPACEBAR can help enhance code clarity and readability.

My last date1/date2 sample code was intended for everyone to understand the situation. In some situation, it's requried to insert a space only.

Anyway, if I discover a more elegant way (such as using VBS) to send space, I'll post my code here. In any case, Macro Scheduler's language definition is one of the most powerful and versatile macros in the world.

Happy scripting.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri May 30, 2003 1:10 am

Well said! And your point re regex is a good one. End result is still up to MJT.

I agree, Macro Scheduler is tops, and so is this forum group. A lot of great minds out there pooling together.

Once again, enjoyed our recent discussion...........
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sat May 31, 2003 8:41 am

Hi,

Space is a CHARACTER. Just as 'A', 'Z', and '@' are characters.

CTRL, ALT and SHIFT are NOT characters. Furthermore they are action keys which are sent down with other characters.

Therefore, we have a Press command from CTRL, ALT and SHIFT but NOT for Space bar, because it isn't needed and doesn't make any sense.

You wanna send a space character? Send it:

Send>

You can't see it of course, but :

Send>Hello World

has a space character in it - between Hello and World.

So, to press the space bar (you mean send a space character) use the Send command. To press the 'A' key (send an 'A' character) use the send command.

BTW - this is in the FAQs on the web site. But no one ever reads FAQs anyway huh?
MJT Net Support
[email protected]

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sat May 31, 2003 11:39 pm

Hi Support

The only challenge of coding Sen> is the automatic truncation by most text editors such as Multi-Edit.

The inclusion or exclusiion PRESS SPACEBAR won't cause a huge impact whatsoever to my daily scripting.

It's just my two cents. Thanks for your reply.

bmelendy

Need Press SpaceBar

Post by bmelendy » Fri Jan 21, 2005 4:12 pm

I know this is an old thread, but there really is a good reason for needing the Press SpaceBar.

I actually have need to Press the Spacebar in one of my scripts, and I'd like to do it without using the mouse to click. What I'm trying to do is to minimize a window, and I wanted to use ALT-Spacebar to activate the control box menu.

Anyone have any better ideas, or maybe it would be nice to have that press-spacebar function. ;-)

....Brad

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

Post by Marcus Tettmar » Fri Jan 21, 2005 4:19 pm

You obviously didn't read this thread fully, because the answer is right there after the first poster's question. This question is asked frequently. Which is why it is also in the FAQs on the web site.

Anyway, space is an ordinary character, like A and B. It is not a special key like ALT or CTRL. So we use the Send command. You can send "hello world how are you today" with the Send/Character Text (Send) command right? That's 5 spaces sent (or 5 times the space bar has been pressed) right there. So to send space on it's own we do:


Send>
^ -- There's a space at the end of the line here


So to send ALT-space-n to minimize a window we just need to do this:

Press ALT
Send> n
Release ALT

Note the space before the n.

Simple.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sat Jan 22, 2005 12:02 am

Hi mtettmar (Support) & bmelendy,

For the sake of script readability, I still believe that addition of PRESS SPACEBAR is needed.

mtettmar, your solution (Send>space) works fine in Macro Scheduler editor, but not other program editors. I create and modify all scripts in Multi-Edit, which chops off all trailing spaces automatically. Of course, Send> n doesn't contain any training space.

Instead, I use ASC>32 to simulate the PRESS SPACEBAR. It isn't elegant but serves the purpose. After all, we don't live in a perfect world.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sat Jan 22, 2005 7:18 am

Hi,

I'm surprised a text editor would remove characters without your approval! Well you could do this:

Let>SPACE={" "}
Send>%SPACE%

Put the first line at the top of your script and then wherever you need to use a space at the end of a line put %SPACE%
MJT Net Support
[email protected]

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sat Jan 22, 2005 9:03 am

without your approval
Not exactly! I supposed it's the default behavior most program editors (such as Multi-Edit and UltraEdit). That is, whenever saving or loading a file, all trailing space(s) and tab(s) will be truncated automatically. Of course, it's user-definable. In Multi-Edit, you can alter it in Customize|Editing dialog.

Thanks a lot for showing us Let>SPACE={" "}. I didn't know it's doable.

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