Created
July 4, 2011 16:12
-
-
Save mottram/1063555 to your computer and use it in GitHub Desktop.
Midipipe script for controlling Chrome/Reeder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on runme(message) | |
tell application "System Events" to set FrontAppName to name of first process where frontmost is true | |
if FrontAppName is "Google Chrome Canary" then | |
if (item 1 of message = 144) and (item 2 of message = 40) and (item 3 of message > 0) then | |
tell application "System Events" | |
tell process "Google Chrome Canary" | |
click menu item "Instapaper" of menu "Bookmarks" of menu bar 1 | |
end tell | |
end tell | |
end if | |
if (item 1 of message = 144) and (item 2 of message = 41) and (item 3 of message > 0) then | |
tell application "System Events" | |
tell process "Google Chrome Canary" | |
click menu item "Readable" of menu "Bookmarks" of menu bar 1 | |
end tell | |
end tell | |
end if | |
else if FrontAppName is "Reeder" then | |
if (item 1 of message = 144) and (item 2 of message = 40) and (item 3 of message > 0) then | |
tell application "System Events" | |
tell process "Reeder" | |
click menu item "Send to Instapaper" of menu "Services" of menu bar 1 | |
end tell | |
end tell | |
end if | |
if (item 1 of message = 144) and (item 2 of message = 41) and (item 3 of message > 0) then | |
tell application "System Events" | |
tell process "Reeder" | |
click menu item "Save to Pinboard…" of menu "Services" of menu bar 1 | |
end tell | |
end tell | |
end if | |
if (item 1 of message = 144) and (item 2 of message = 36) and (item 3 of message > 0) then | |
tell application "System Events" | |
keystroke "j" | |
end tell | |
end if | |
if (item 1 of message = 144) and (item 2 of message = 37) and (item 3 of message > 0) then | |
tell application "System Events" | |
keystroke "k" | |
end tell | |
end if | |
if (item 1 of message = 144) and (item 2 of message = 39) and (item 3 of message > 0) then | |
tell application "System Events" | |
keystroke "b" using command down | |
end tell | |
end if | |
end if | |
end runme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment