Jump to content

key code in applescript only works in some apps


Recommended Posts

hey there,

 

My goal is:

 

type "ms" in Alfred to trigger the keyboard shortcut "cmd-shift-7" to invoke the help menu in the current app. "cmd-shift-7" is the standard keyboard shortcut to do that, but it is cumbersome to use.

 

What I tried:

keyword → RunNSAppleScript

 

my AppleScript:

on alfred_script(q)

  	tell application "System Events"
	   key code {26} using {command down, shift down}
  	end tell

end alfred_script

 

This does work on most apps, but not all apps, despite the short cut "cmd-shift-7" works in those apps. What am I missing here?

Edited by WalterBeiter
Link to comment

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...