Yet another modifier and a click

I have a strange effect:


set x to 1
repeat while x <= 30
	run Library.ClickSomewhere
	Wait 5
	run Library.CommandKeystroke
	Wait 5
	add 1 to x
end repeat

ClickSomewhere is a simple click on some button.
CommandKeystroke is to save a document. Syntax in handler is:

		
TypeText CommandKey & "s"

In 3 test runs of this code at some unspecific point (at 2, at 19, at 11) the code does not ClickSomewhere instead it CommandKey’s ClickSomewhere. I do not want that :wink:

Why is that?

I expanded the last wait to 20s but the latest run failed again at 22.


Thu, 3/19/09 10:49:50 AM	typetext		Eggplant was here: did something
Thu, 3/19/09 10:49:55 AM	log		 ----->  SimplyTypingEnter
Thu, 3/19/09 10:49:55 AM	typetext		「enter」
Thu, 3/19/09 10:50:00 AM	log		 ----->  SaveCommand
Thu, 3/19/09 10:50:00 AM	typetext		「commandKey」s
Thu, 3/19/09 10:50:20 AM	log		Lopp: 22 / 30
Thu, 3/19/09 10:50:20 AM	log		 ----->  openDocument
Thu, 3/19/09 10:50:24 AM	doubleclick	document	at (140, 762)
Thu, 3/19/09 10:50:24 AM	waitfor	openDocumentFinished	found at (412, 115)
Thu, 3/19/09 10:50:24 AM	log		4 sec. openDocument duration
Thu, 3/19/09 10:50:29 AM	log		 ----->  createAPage
Thu, 3/19/09 10:50:33 AM	click	createPage	at (1049, 588)
Thu, 3/19/09 10:50:38 AM	log		 ----->  AddSomethingToTheDocument
Thu, 3/19/09 10:50:38 AM	typetext		「commandKey」d

I forgot there is also a CommandKey usage after the affected Click. Above is the log of the last run.

Just to name the problem again:
“click createPage” is sometimes executed with the commandkey down which it should not and does not on 99% percent of all other loop runs.

Hi–

One thing that might help is to add a KeyUp AllKeys after that typeText line in your commandKeystroke handler, or you could switch it to from typeText to TypeCommand:

typeCommand "s"

Let me know if either of these work.

Let me know if either of these work.
I will try this tomorrow and let you know. Thanks.

May I ask a diferent question. In SE is there any other way to “jump” over parts of a script without “commenting” the parts who should be ignored?

After talking with the developers a little more, I have a few questions:

  1. What is the OS on your SUT
  2. Which VNC server are you using?
  3. If it’s a mac, Are you using an off-screen (secondary) user on a machine?

Thanks!

[quote=“MSchrempp”]
May I ask a diferent question. In SE is there any other way to “jump” over parts of a script without “commenting” the parts who should be ignored?[/quote]
You could set some true/false “flags” at the top of your script, and switch them out as you go:

set doSection1 to false
set doSection2 to true

if doSection1 is true
//first chunk
end if

if doSection2 is true
//second chunk of stuff
end if

Hope this helps!

Allen

  1. What is the OS on your SUT
    Mac OS X, Leopard, 10.5.6
  1. Which VNC server are you using?
    VineServer 3.0 (1016)
  1. If it’s a mac, Are you using an off-screen (secondary) user on a machine?
    Not quit sure what you mean by that, I assume the answer is no.

[quote=“MSchrempp”]

  1. If it’s a mac, Are you using an off-screen (secondary) user on a machine?
    Not quit sure what you mean by that, I assume the answer is no.[/quote]

Thanks for the info. On the last question, are you running scripts against your machine using another user account?

One thing that might help is to add a KeyUp AllKeys
I did that and so far I was able to run the code 2 times without running into the effect. 8)

On the last question, are you running scripts against your machine using another user account?
There is another non Admin user account available on the box but it is and was never used for vnc access. The standard admin user is logged while working with vnc.

Hm, well, 3rd and 4th run lead to the same effect.

Does using TypeCommand AND KeyUp may help?

This shouldn’t happen if you have the VNC Server setup with the correct settings.

First, I recommend getting the latest VNC Server available here:
http://www.redstonesoftware.com/downloads/VineServer3.1Beta2.dmg

Second, you should set Preferences->Device->Keyboard Events to User Session Events.

Let us know if that does not resolve your situation.

Second, you should set Preferences->Device->Keyboard Events to User Session Events.

Yes, I found this setting set to the default and changed it accordingly. I did 5 runs and 4 of them run successfull, one run did not.

When will be the final release of VineServer 3.1?
At the moment I refrain from installing a beta. I hope you understand. The above result is ok for me and if 3.1 will come out and I will achieve 5 of 5 runs then it is fine for me at the time beeing. The script runs around 2 hours time and there is not enough time to test this further more… as always :wink: