Press CTRL problem?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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

Press CTRL problem?

Post by Bob Hansen » Mon Oct 21, 2002 7:53 am

I hope this is just a glitch on my machine and not a real problem, but, I have started doing some new scripts with version 7.0 and seem to be having problems when using "Press CTRL". My application is acting like it has a SHIFT-CTRL instead of CTRL. I also see that CTRL-HOME is not working, but ALT-HOME works instead. I am using simple commands:

Examples:
===========================
//To copy text:

Press CTRL
Send>V
Release CTRL

This is working like CTRL-SHIFT-V instead of like CTRL-V
===========================
//To go to start of document in text editor:

Press CTRL
Press HOME
Release CTRL

I have to use ALT-HOME vs. CTRL-HOME (And ALT-Home does not work from the keyboard, and it shouldn't).
===========================
The CTRL-C and CTRL-Home functions work if I am in the program and typing on the keyboard. I have been able to find another keystroke command string to "Send>" as a work around for doing the Copy function (Edit, Copy), but cannnot find an alternate method for CTRL-Home.

I don't know if this is a new glitch from version 7.0. I will have to check it out on my earlier version of Macro Scheduler when I get a chance. But I thought I should send up an early flag for others to watch for this.

(The text editor I am using is TextPad, version 4.50 which I have been using for years with Macro Scheduler).

Guest

Post by Guest » Tue Oct 22, 2002 4:24 am

try a lower case v in the macro.... that looks like an upper case V.

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 » Tue Oct 22, 2002 6:41 am

:oops: Thanks a lot, Guest.....

When I read your comment, I thought that I had only used Upper Case on the example in the forum, but looking at the script I found that I was using Upper Case. I changed it to Lower Case, and that problem is now fixed. Glad it was not a Version 7 issue (I should know better Marcus!).

Your suggestion took care of the CTRL-V problem. Taking a closer look at the Hot Keys in TextPad, I see about 10 of them that combine CTRL and SHIFT. I will make it a habit to always use lower case with CTRL,ALT, and SHIFT combinations. In many cases it may not matter, but apparently it does make a difference. As an extra precaution I am now putting CapsOff at the beginning of every macro.

Still need to look closer at the CTRL-HOME issue

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

Re: Press CTRL problem?

Post by support » Tue Oct 22, 2002 6:50 am

The first problem is because you are using an upper case V. This will act as if Shift is down (Shift-v). You should do:

Press CTRL
Send>v
Release CTRL

In any case CTRL-v *pastes* not copies. For Copy use c, i.e.:

Press CTRL
Send>c
Release CTRL

I cannot reproduce the CTRL-HOME phenomenon - tried it with TextPad and it does what I expect. CTRL-HOME moves cursor to first position in file, ALT-HOME moves cursor to first line, same position in line as the cursor was on the line before ALT-HOME was pressed. Get the same results whether I issue them manually or from a Macro Scheduler script:

This is my test macro which worked as expected:

SetFocus>TextPad*
//Move to end and highlight
Press Shift
Press Ctrl
Press End
Release Ctrl
Release Shift

//Copy to clipboard
Press Ctrl
Send>c
Release Ctrl

//Move to beginning again
Press Ctrl
Press Home
Release Ctrl

//Display copied clip
Wait>5
GetClipBoard>clip
MessageModal>clip

Tested with expected results on TextPad 4.5.0 on WinXP and Win98SE.

Perhaps we need to look more closely at your script?
bob hansen wrote:
//To copy text:

Press CTRL
Send>V
Release CTRL

This is working like CTRL-SHIFT-V instead of like CTRL-V
===========================
//To go to start of document in text editor:

Press CTRL
Press HOME
Release CTRL
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 » Tue Oct 22, 2002 8:21 am

Sorry about any confusion with "c" vs. "v", but the problem definitely was because I was not using lower case.

The CTRL-HOME function was not working because TextPad still had some "blocked" text highlighted, and doing CTRL-HOME was just extending the selected section vs. just going to the top.

I think that I may have found the problem. My script was more complex than the sample I provided. In reviewing it, I found that I had not done a "Release SHIFT" while trying to block some text for copying. I have since corrected that, and it looks like I may be in good shape again.

If this does not fix it, I will submit the script for your review.

Can I also include a file attachment when submitting from the forum? I don't see a button to do that.

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

Post by support » Wed Oct 23, 2002 10:41 am

Hi,

Sorry, no file attachments here. If posting a script, copy and paste it, but please try to cut it down to show only the relevant portions as otherwise it makes the forum hard for people to read.

If an attachment or actual script file is necessary then email it to [email protected]

If meant for public consumption I'd suggest either a link to a file on another site if you have such capability, or just ask people to email you if they want it.

When posting a message use ALT+w to insert a URL link.
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 » Wed Oct 23, 2002 2:43 pm

Problems appear to be solved. :D

:arrow: The CTRL-v problem was caused by using UpperCase vs. Lower.

:arrow: The CTRL-HOME problem was caused by not entering a Release Shift command earlier in the script.

I later ran into the same problem with CTRL-f and it also was an UpperCase vs. Lower case issue.

Apparently TextPad is very sensitive to the case of the letter when it is on Send> whether or not Press Shift has been entered.

Press CTRL
Send>F
Release CTRL

is the same as CTRL-SHIFT-F hot key sequence vs. what I would have normally used:

Press CTRL
Press SHIFT
Send>F
Release SHIFT
Release CTRL

:idea: Now I just have to remember to always use lower case letters with SEND> when using TextPad.

Thanks for the help with this....(it all turns out to be operator error, what a dummy!) :oops:

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