Skip to content

Instantly share code, notes, and snippets.

@stevenschobert
Last active August 29, 2015 14:13
Show Gist options
  • Save stevenschobert/1947c0e6b12931f51625 to your computer and use it in GitHub Desktop.
Save stevenschobert/1947c0e6b12931f51625 to your computer and use it in GitHub Desktop.
Quickly open my "Inbox" and "Today" perspectives in OmniFocus
tell application "OmniFocus" to activate
tell application "System Events"
tell process "OmniFocus"
set perspectivesMenu to the first menu bar item of item 1 of menu bars whose name contains "Perspectives"
set inboxMenuItem to the first menu item of the first menu of perspectivesMenu whose name is "Inbox"
set viewMenu to the first menu bar item of item 1 of menu bars whose name contains "View"
click inboxMenuItem
set sidebarMenuItem to the first menu item of the first menu of viewMenu whose name contains "Sidebar"
set inspectorMenuItem to the first menu item of the first menu of viewMenu whose name contains "Inspector"
set toolbarMenuItem to the first menu item of the first menu of viewMenu whose name contains "Toolbar"
if the name of sidebarMenuItem contains "Show" then click sidebarMenuItem
if the name of inspectorMenuItem contains "Show" then click inspectorMenuItem
if the name of toolbarMenuItem contains "Show" then click toolbarMenuItem
set inboxWindow to the first window whose name is "Inbox"
set the size of inboxWindow to {1200, 725}
set the position of inboxWindow to {45, 55}
end tell
end tell
tell application "OmniFocus" to activate
tell application "System Events"
tell process "OmniFocus"
set perspectivesMenu to the first menu bar item of item 1 of menu bars whose name contains "Perspectives"
set todayMenuItem to the first menu item of the first menu of perspectivesMenu whose name is "Today"
set viewMenu to the first menu bar item of item 1 of menu bars whose name contains "View"
click todayMenuItem
set sidebarMenuItem to the first menu item of the first menu of viewMenu whose name contains "Sidebar"
set inspectorMenuItem to the first menu item of the first menu of viewMenu whose name contains "Inspector"
set toolbarMenuItem to the first menu item of the first menu of viewMenu whose name contains "Toolbar"
if the name of sidebarMenuItem contains "Hide" then click sidebarMenuItem
if the name of inspectorMenuItem contains "Hide" then click inspectorMenuItem
if the name of toolbarMenuItem contains "Hide" then click toolbarMenuItem
set todayWindow to the first window whose name is "Today"
set the size of todayWindow to {450, 700}
set the position of todayWindow to {800, 55}
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment