Index
August 7, 2026 ยท View on GitHub
Important
Aug 7, 2026: I have moved away from using AppleScript and haven't had time to update the code in this repository. Some of these scripts may not work with more recent versions of MacOS, however most of these snippets are basic enough that you should not run into many issues. This repository may be archived in the near future. Thanks to all visitors and contributors.
This repository is a collection of Applescript snippets that can be used individually or part of a larger project. Many of these snippets were written as I was learning to use Applescript and may not represent the best method of undertaking a particular task.
This code lives at Github.
Script Categories
- Application Services
- Battery Monitor
- Display Settings
- File and Folder Actions
- Location Helper Scripts
- Markdown Tools
- Notational Velocity
- Pandoc and Textutils
- Reminders App
- Snippets
- Sound Scripts
- Temperature Conversion
- Terminal
- Time and Date
Links/Dependencies
Caffeine App - a menu bar application that prevents your monitor from sleeping.The original Caffeine App is no longer available.- There are also several other applications that achieve the same goal.
- If you don't want an extra application in your menubar you can use
pmset noidle- this command must be run as
do shell script "/usr/bin/pmset noidle > /dev/null 2>&1 &"to prevent the script from waiting for the shell command to complete.
- this command must be run as
- Or if you're on 10.8+ you can use the built-in
caffeinatecommand, though it may be broken after Yosemite (10.10). caffeinateandpmset noidlecan be run via thedo shell scriptApplescript command.
- Pandoc and Textutil - document conversion via the command line.
Youtube-Post.scptrequires GoogleCL, which is also useful for blogger, google calendar, and contacts- GoogleCL is sadly defunct. Any associated scripts remain for posterity.
- I have also created a few Gists for more specific applescript/bash related tasks.
Other Applescript Resources/Libraries
Note
There may be broken links below, however you should be able to find these resources with a basic Google / DuckDuckGo search.
Tools for Developing Scripts
Free
- Location Helper - use core location in applescripts.
- Twitter Scripter - interact with Twitter via applescript.
- Platypus - package applescripts with various other scripts (Shell, Python, etc) to create native MacOS applications.
Paid
- CursorCoordinates - get x,y coordinates for clicking and window positions.
- Dialog Maker - tool to help create dialog boxes
- Script Debugger - An integrated development environment for Applescript
A non-exhaustive list of interesting Applescript resources on Github:
Note Taking/Task Management
Coding
- iTerm and Sublime Text
- Custom Iterm Applescripts for Alfred
- Execute Applescript with Node.js
- Execute Applescript with Go
Productivity
Other useful Applescript resources / tutorials / etc
- Basics of Applescript
- Free ebook covering the foundations of applescript scripting. Published in 2014.
- Introduction to AppleScript Language Guide
- MacOSX Automation/Applescript
- written by Sal Soghoian, the former Apple product manager for automation technologies
- MacScripter Forums
- MacRumors/Mac Programming Forum
- not explicitly applescript related, but searching for "Applescript" provides some useful results
- A thorough explanation of "do shell script" in Applescript
For JavaScript Users
- JavaScript for Automation Cookbook
- JavaScript was added as a MacOS automation tool in version 10.10. If you are familiar with (or would prefer to learn) JavaScript, this cookbook is a great resource.
Bugs / Contributing
Scripts in this repo were tested on OS X/MacOS Lion through High Sierra. Some scripts may not work on more recent versions of MacOS.