Skip to content

Instantly share code, notes, and snippets.

@jkereako
Last active August 22, 2020 18:01
Show Gist options
  • Save jkereako/2cfbeb39158d82e5ce764073f0120142 to your computer and use it in GitHub Desktop.
Save jkereako/2cfbeb39158d82e5ce764073f0120142 to your computer and use it in GitHub Desktop.
Toying with a start-up script for my MacBook Pro.
# Open Safari
tell application "Safari"
# Default to HackerNews
open location "https://news.ycombinator.com"
activate
end tell
# Open Outlook if you have it.
try
tell application "Microsoft Outlook"
activate
end tell
on error
# do nothing
end try
# Open Slack if you have it
try
tell application "Slack"
activate
end tell
on error
# do nothing
end try
# Open Terminal and update Homebrew packages.
# This can take a while.
tell application "Terminal"
activate
do shell script "/usr/local/bin/brew update; /usr/local/bin/brew upgrade; /usr/local/bin/brew cask upgrade; /usr/local/bin/brew cleanup"
end tell
# Notify the user
display notification "The startup script completed successfully." with title "You're ready to roll!" sound name "Glass"
@jkereako
Copy link
Author

jkereako commented Jan 27, 2018

Every day I open the same applications and type in the same commands, you probably do as well.

What it does:

  • Opens Safari to HackerNews
  • Opens Outlook
  • Opens Slack
  • Opens Terminal and updates Homebrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment