Last active
November 17, 2017 22:50
-
-
Save briangonzalez/cd19ac31de811b23e557f61bc89f7f1e to your computer and use it in GitHub Desktop.
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
activate application "Reminders" | |
tell application "Finder" | |
set _b to bounds of window of desktop | |
set _width to item 3 of _b | |
set _height to item 4 of _b | |
end tell | |
tell application "System Events" | |
try | |
-- Attempt to show the sidebar. If it throws | |
-- an error, we know the sidebar is already | |
-- open, so we close it. | |
-- If it works, we immediately close it. | |
tell process "Reminders" | |
click menu item "Show Sidebar" of menu "View" of menu bar 1 | |
end tell | |
keystroke "s" using {option down, command down} | |
on error errMsg | |
-- Close the sidebar because it's open. | |
keystroke "s" using {option down, command down} | |
end try | |
-- Put it in the upper right hand corner. | |
set position of first window of application process "Reminders" to {_width - 300, 40} | |
set size of first window of application process "Reminders" to {560, 400} | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment