Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Shift Down in Applescript from FM10 gives 'a'

Featured Replies

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.

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

  • 2 weeks later...
  • 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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.