Skip to content

Instantly share code, notes, and snippets.

@jeanbaptistebeck
Last active February 3, 2016 09:54
Show Gist options
  • Save jeanbaptistebeck/a15a9f57e00b249c6307 to your computer and use it in GitHub Desktop.
Save jeanbaptistebeck/a15a9f57e00b249c6307 to your computer and use it in GitHub Desktop.
Messing around with AppleScript

Playing with applications

tell application "Spotify"
  play track "spotify:track:51pQ7vY7WXzxskwloaeqyj"
end tell
tell application "Finder"
  empty the trash
end tell
quit application "Microsoft Word"

Send notifications

display notification "Faire le point" with title "Rappel" sound name "Glass"

A living terminal

say -v Cellos "di di di di di di di di di di di di di di di di di di di di di di di di di di"
say "Je ne parle pas bien anglais, mais par contre je parle très bien français"

How to execute ?

either osascript filename.scpt or osascript -e "a short script here"

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