Last active
December 19, 2015 07:38
-
-
Save BrettBukowski/5919695 to your computer and use it in GitHub Desktop.
LaunchAgent to auto-invoke applescript opening Google Hangout
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>Launch Daily Standup Hangout</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/osascript</string> | |
<string>/Users/brettb/launchStandupHangout.scpt</string> | |
</array> | |
<key>StartCalendarInterval</key> | |
<array> | |
<dict> | |
<key>Weekday</key> | |
<integer>1</integer> | |
<key>Hour</key> | |
<integer>9</integer> | |
<key>Minute</key> | |
<integer>58</integer> | |
</dict> | |
<dict> | |
<key>Weekday</key> | |
<integer>2</integer> | |
<key>Hour</key> | |
<integer>9</integer> | |
<key>Minute</key> | |
<integer>58</integer> | |
</dict> | |
<dict> | |
<key>Weekday</key> | |
<integer>3</integer> | |
<key>Hour</key> | |
<integer>9</integer> | |
<key>Minute</key> | |
<integer>58</integer> | |
</dict> | |
<dict> | |
<key>Weekday</key> | |
<integer>4</integer> | |
<key>Hour</key> | |
<integer>9</integer> | |
<key>Minute</key> | |
<integer>58</integer> | |
</dict> | |
<dict> | |
<key>Weekday</key> | |
<integer>5</integer> | |
<key>Hour</key> | |
<integer>9</integer> | |
<key>Minute</key> | |
<integer>58</integer> | |
</dict> | |
</array> | |
</dict> | |
</plist> |
This file contains 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 run argv | |
set location to "https://plus.google.com/hangouts/_/e5004c1b005ddf21" | |
if length of argv > 0 then set location to item 1 of argv | |
tell application "System Events" | |
tell application "Safari" to activate | |
tell process "Safari" | |
click menu item "New Tab" of menu "File" of menu bar 1 | |
end tell | |
end tell | |
tell application "Safari" | |
set URL of document 1 to location | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This system auto-launches Safari to a Google Hangout every weekday at 9:58 am.
~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/Launch\ Google\ Hangout.plist
launchStandupHangout.scpt
has the added benefit of using a passed-in URL to navigate the browser to instead.e.g.
osascript ~/launchStandupHangout.scpt
-> goes to the default URL specified on line 2.osascript ~/launchStandupHangout.scpt 'http://google.com'
-> goes to google.com instead.