Applescript automate double keystroke

applescript

I need to emulate a keystroke using applescript for double time shift press.

Adding Part of snippet..

tell application "System Events"
    keystroke shift
    keystroke shift
end tell

Even tried

keystroke shift
delay 0.1
keystroke shift

still doesn't work. Any ideas?

Best Answer

You need to key down followed by key up:

tell application "System Events"
    key down shift
    key up shift
    key down shift
    key up shift
end tell