Jump to content
WalterBeiter

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

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...