April 23, 200916 yr 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.
April 23, 200916 yr 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
May 7, 200916 yr Author 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.
Create an account or sign in to comment