Is it possible to have the space bar pressed?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Guest

Is it possible to have the space bar pressed?

Post by Guest » Thu Apr 08, 2004 8:26 pm

Is it possible to have the space bar pressed? I know:

Press Tab

Will click on "Tab" what can i do to get that to work on the space bar?

Thanks

Ted

Post by Ted » Thu Apr 08, 2004 8:50 pm

I noticed this thread about the space bar "problem":

http://www.mjtnet.com/forum/viewtopic.p ... =space+bar

Although it seems that some of you think it is unnecessary, I found it an easy way of making a checkbox "on" or "off" (tab to a checkbox on a web page, then click on the space bar). I know there is a "SetCheckBox" command, but it can be a problem when you are dealing with frames.

Any thoughts?

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

Post by support » Thu Apr 08, 2004 9:23 pm

Space is a character. To send a space, er, just send a space :

Send>

There's a space at the end of the above line.

The following command sends a space between Hello and World. To send a space on it's own just enter a space on it's own.

Send>Hello World
MJT Net Support
[email protected]

Guest

Post by Guest » Thu Apr 08, 2004 9:26 pm

I need the space bar to be clicked so I can toggle a checkbox on/off on a webpage. The problem is, it's in a frame, so I'm having trouble using the "SetCheckBox" function.

Any suggestions?

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

Post by support » Thu Apr 08, 2004 9:28 pm

This is just a matter of making sure the correct window is focused. If the frame is in focus then the command should work ok. Otherwise just Tab to the field and press space.
MJT Net Support
[email protected]

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 Apr 08, 2004 11:34 pm

This is third reply to same question. See earlier answer at:
http://www.mjtnet.com/forum/viewtopic.php?t=897
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Guest

Post by Guest » Fri Apr 09, 2004 12:23 pm

support wrote:This is just a matter of making sure the correct window is focused. If the frame is in focus then the command should work ok. Otherwise just Tab to the field and press space.
I can tab to the field, but how do I press "space" after I get there. That's what I'm asking. I'd rather not use mouse moving commands especially since I can't lock the keyboard once the macro starts.

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

Post by support » Fri Apr 09, 2004 2:00 pm

I can tab to the field, but how do I press "space" after I get there. That's what I'm asking. I'd rather not use mouse moving commands especially since I can't lock the keyboard once the macro starts.
As I said before, to press space send a space. To tab use "Press Tab" to press space use "Send> ". Say you had to tab 5 times and then press space, you would do the following:


Press Tab * 5
Send>
^--- there is a space here


Space is a character just like A and B are characters. There is no Press A or Press B command because they are characters. We use Send Character/Text (or Send) for short. So we use Send>A or Send>B and so on. Since space is a char just like A and B we use "Send> " (without the quotes - they are here just so you can see the space char).

"Send> " sends the space char. This is what happens when you press the "space bar" and therefore it is what you need to do if you wish to "Press Space".

I hope this finally makes sense.
MJT Net Support
[email protected]

Guest

Post by Guest » Fri Apr 09, 2004 2:20 pm

support wrote:
..."Send> " sends the space char. This is what happens when you press the "space bar" and therefore it is what you need to do if you wish to "Press Space".

I hope this finally makes sense.
Thanks for the help.

Lumumba

Post by Lumumba » Fri Apr 09, 2004 3:38 pm

To identify a space character in a document: use CTRL+A. This command will only mark "real" characters and the space char is a member of that family :wink:.

A standard in this forum is the cut&paste of code (like the one below)
Both lines look the same, isn't it ?
But ...

//this line has a trailing space character
Label>WithASpace

//this line has not a trailing space character
Label>WithoutASpace

Guest

Post by Guest » Tue Apr 13, 2004 11:57 pm

Thanks for the tips on "Send> " and CTRL>a (who was it on this site who said always use small letters for commands like Send> and CTRL> since a capitol might be interpreted as having the shift key pressed?).

Does anyone know a font that uses, say a rectangle for all the spaces? The CTRL>a command seems to leave too much room at the end of the line for me to quickly spot a space.

Font OCR-A BT is a bit better with CTRLa

jalbt51

Lumumba

Post by Lumumba » Wed Apr 14, 2004 3:16 pm

In some cases (have a try) key combinations like CTRL + could be interpreted in a different way (by the system) if an upper or lower case character is used eg. :

CTRL + a

or

CTRL + A

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