var TextEdit = Application ( "TextEdit" ) ; TextEdit . activate ( ) ; delay ( 1 ) ; sys = Application ( "System Events" ) ; sys . keystroke ( "a" , { using : "command down" } ) ; sys . keystroke ( "p" , { using : [ "command down" , "shift down" ] } ) ;