Jump to content
Server Maintenance This Week. ×

Shift Down in Applescript from FM10 gives 'a'


This topic is 5472 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

So am moving a database from FM6 to FM10.

The database uses Applescript to 'talk' to an external application.

It appears that in FM10 the Applescript command 'key down shift' actually generates an output of 'a'.

The script I'm generating by calculation is:

tell application "appname" to activate

tell application "System Events"

tell process "appname"

keystroke "c"

key code 29

key down shift

keystroke "t"

key up shift

key code 23

keystroke "g"

end tell

end tell

tell application "appname" to activate

This should type the sequence 'c0T5g' into the target application. If I copy and paste the script into ScriptEditor and run it from there, it does exactly that.

If I run it from FM10 using 'Perform Applescript' I get 'c0at5g' which, unsurprisingly, doesn't do what I need it to do.

Anyone else seen this? Don't know if it's new to 10 or something that's been there since 9?

(I can't just send 'T' instead of shift-t because the receiving app doesn't respond to capital letters via AppleScript properly).

Any help gratefully received.

Thanks,

Rob.

Link to comment
Share on other sites

Did you try this (or is this what you meant by "can't send T")?

tell application "TextEdit" to activate

tell application "System Events"

tell process "TextEdit"

keystroke "c"

key code 29

keystroke "t" using shift down

key code 23

keystroke "g"

end tell

end tell

tell application "TextEdit" to activate

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

Yes, I have tried 'using shift down', it does work, and that is the 'solution' I am using at present.

I am still curious as to why 'key down shift' does not work in FM10 when it does work in FM6 (and in Applescripts generated 'by hand'), and why FM10 sends out a 'garbage' "a" character....

Rob.

Link to comment
Share on other sites

This topic is 5472 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.