Problem with 'Press CTRL' and citrix

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

JonHodgson
Newbie
Posts: 12
Joined: Wed Mar 02, 2005 9:32 pm

Problem with 'Press CTRL' and citrix

Post by JonHodgson » Wed Mar 02, 2005 9:58 pm

I don't think "Press CTRL" works over citrix.

As a simple test I opened Excel thru citrix and then recorded the following:

I clicked on a cell with some text, pressed CTRL-c to copy, clicked on another cell and pressed CTRL-v to paste it.

When I played it back it simply sent 'c' & 'v' -- no CTRL.

I then ran that same script against a local copy of Excel and it worked fine, copy-n-pasting.

Here's the code...


Press CTRL
Wait>0.45
Send>c
Wait>0.85
Release CTRL
Wait>0.43
MouseMove>135,178
Wait>1.05
LClick
Wait>1.2
Press CTRL
Wait>0.52
Send>v
Wait>0.54
Release CTRL



Any ideas? Is there some way I can simply send CTRL-C ?

I think the following post had a simliar issue:
http://www.mjtnet.com/forum/viewtopic. ... ght=citrix

Please help!

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

Post by support » Wed Mar 02, 2005 10:12 pm

Odd. Just out of interest, try this:

VBSTART
Sub CtrlC
Set Wsh = CreateObject("Wscript.Shell")
'change app name below
Wsh.AppActivate "Notepad"
Wsh.SendKeys "^c"
End Sub
VBEND
VBRun>CtrlC

For more info on this method of sending keystrokes see:
http://www.mjtnet.com/forum/viewtopic.php?t=1696
MJT Net Support
[email protected]

JonHodgson
Newbie
Posts: 12
Joined: Wed Mar 02, 2005 9:32 pm

Post by JonHodgson » Wed Mar 02, 2005 10:41 pm

Unfortunately that didn't work in the citrix app, but it did work in the local running Excel.

This stinks, i just hit a brick wall. :(

If you have any other ideas, please send 'em over

JonHodgson
Newbie
Posts: 12
Joined: Wed Mar 02, 2005 9:32 pm

Post by JonHodgson » Wed Mar 02, 2005 10:58 pm

I also tried simply ALT-e to get to the edit menu, but ALT doesn't work either. Neither does SHIFT.

Press F1 does work, if that helps you figure out why it's breaking.

JonHodgson
Newbie
Posts: 12
Joined: Wed Mar 02, 2005 9:32 pm

Post by JonHodgson » Wed Mar 02, 2005 11:20 pm

If you'd like to try it out, I found a company with a demo app on citrix. It has the same issue.

To test simply open up an outlook note, write some text and try to cut-n-paste it.

http://forms.frontrange.com/form.asp?fid=65

Thanks,

Jon

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

Post by support » Fri Mar 04, 2005 5:16 am

Hi,

We have found a solution for handling ctrl/shift/alt under Citrix.

It appears that a change we made some time back to fix an issue sending these keystrokes in Windows 2000 stopped them working under Citrix. Typical! Therefore, rather than unfix it again, we have added a variable called SK_LEGACY which can be set to 1 to force MSched to use the old method for sending these keys.

Jon has tested this successfully and the solution will be available in the next update.
MJT Net Support
[email protected]

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

Post by support » Fri Mar 04, 2005 11:13 am

Hi,
JonHodgson wrote:If you'd like to try it out, I found a company with a demo app on citrix. It has the same issue.

To test simply open up an outlook note, write some text and try to cut-n-paste it.

http://forms.frontrange.com/form.asp?fid=65
As it happens, I was unable to replicate the problem here. This also has me a little confused. I was under the impression you were running Macro Scheduler *within* a citrix environment. This message implies you are actually connecting remotely to a workstation via citrix with Macro Scheduler installed on the local machine and controlling the citrix session via your machine. In which case there should be no issue other than network lag.

Anyway, I was able to open up a note and simulate CTRL sequences successfuly without having to use SK_LEGACY. I did have to slow the process down a lot to allow for network lag. Basically at the above page you are looking at a Java frame containing the screen of the remote machine. The Java app is simply transferring mouse and keyboard events one way and screen images the other. One has to use the mouse to click in the screen before any input can be simulated to allow the java app to capture the mouse and keyboard. Once that is done we can send the keystrokes. I had to slow the mouse click right down to successfully activate the application. Here's my script that works on an Outlook note that has been maximised:

SetFocus>Runaware*
Wait>1
MouseMove>123,285
LDown
Wait>1
LUp
Send>hello world
Wait>1
Press CTRL
Send>a
Release CTRL
Wait>1
Press CTRL
Send>c
Release CTRL

This clicks, slowly (separating the Down and Up), on the window to activate it, and then sends some text "hello world". It then hits CTRL-a to select all the text followed by ctrl-c to copy it to the clipboard.

The text is successfully highlighted and then I am able to paste it back, proving that it was copied to the clipboard.

Note I did not have to use SK_LEGACY.

Can you clarify whether you are running msched on the server or on your local machine to automate a remote session?
MJT Net Support
[email protected]

JonHodgson
Newbie
Posts: 12
Joined: Wed Mar 02, 2005 9:32 pm

Post by JonHodgson » Fri Mar 04, 2005 2:23 pm

I am running msched on my local machine, a Win2K Pro SP4 Dell Latitude D600 Laptop.

I double-checked using your script, and what i got in the outlook note was:

hello worldac

As you can see, the CTRL never made it across so the a & c keypresses were treated as regular typed characters.

When i turned SK_LEGACY on it then worked and copied the text into the clipboard.

Let me know if you want me to run any other tests, but i am indeed still having the issue.

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

Post by support » Fri Mar 04, 2005 2:28 pm

Hi,

That's interesting because that script worked fine here. I'm running XP. So my feeling is this is not neccessarily a Citrix issue after all. Given that you're running msched on your local machine, not within a citrix session and that it works for me, this looks more like a difference between XP and Win2k. The peculiar thing is the SK_LEGACY=1 switch makes it work how it used to work when issues were reported running on Win2k! Doesn't quite make sense.

Anyway, at least you now have a solution with the option of using either method using SK_LEGACY=1/0. The important thing is you have a solution.
MJT Net Support
[email protected]

JonHodgson
Newbie
Posts: 12
Joined: Wed Mar 02, 2005 9:32 pm

Post by JonHodgson » Fri Mar 04, 2005 2:45 pm

I want to publicly say that your responsiveness to this (and other) issues has been outstanding!

It is becoming more rare in this day and age to get good support, however yours has been excellent.

While there are free tools that can technically do some of what MS does, the confidence that I have a great support team watching my back makes all the difference, and worth every penny.

Thanks again.

rmdavis
Newbie
Posts: 2
Joined: Fri Apr 08, 2005 2:02 am
Location: California, USA

CTRL Seems to Work with SK_LEGACY=1 BUT!

Post by rmdavis » Mon Aug 28, 2006 9:41 pm

I am having similar issues with Citrix. Setting variable SK_LEGACY=1 solved the inability to use the CTRL key in a Citrix Window, but when I try to highlight text using the SHIFT END or SHIFT HOME the text remains unhighlighted. I need to copy text to the Clipboard and then into variables to use in another application. Is there any workaround for this?

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

Post by Marcus Tettmar » Mon Aug 28, 2006 10:07 pm

Rick,

I received two support tickets from you today on this issue and have responded with some things to try. I am concerned you are not receiving our emails as you have sent duplicate tickets.

Mail server logs show that your mail server accepted my email for delivery, so you should have received it, but let me know if not.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

Post by shocam » Fri Mar 12, 2010 2:28 pm

mtettmar wrote:Rick,

I received two support tickets from you today on this issue and have responded with some things to try. I am concerned you are not receiving our emails as you have sent duplicate tickets.

Mail server logs show that your mail server accepted my email for delivery, so you should have received it, but let me know if not.
Hi Marcus - I am having the same issue as this, was there a fix for this issue?

Rgds

Mike

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

Post by Marcus Tettmar » Fri Mar 12, 2010 2:34 pm

Shocam - you quoted a post written in 2006 regarding an issue with email not arriving. The fix to the original issue is to use SK_LEGACY. If you have some other issue please clarify and provide some details.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

Post by shocam » Mon Mar 15, 2010 10:34 am

mtettmar wrote:Shocam - you quoted a post written in 2006 regarding an issue with email not arriving. The fix to the original issue is to use SK_LEGACY. If you have some other issue please clarify and provide some details.
Hi Marcus

Sorry for the confusion-I am having trouble with using SHIFT in citrix. I have set SK_LEGACY=1 but citrix will still not recognise the SHIFT key being pressed.

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