A comprehensive VS Code extension providing rich AppleScript language support with advanced features for macOS automation development.
- Rich Syntax Highlighting - Full AppleScript syntax highlighting for
.scpt,.applescript, and.scptdfiles - Intelligent IntelliSense - Auto-completion with 25+ built-in AppleScript keywords, control structures, and common commands
- Custom File Icons - Distinctive AppleScript file icons in the Explorer
- Script Execution - Run AppleScript files directly from the editor with
Cmd+R - Selection Execution - Execute only selected AppleScript code with
Cmd+Shift+R - Dictionary Support - Load additional application dictionaries (SDEF files) for enhanced IntelliSense
- Code Snippets - Pre-built code snippets for common AppleScript patterns
- Error Handling - Comprehensive error handling with helpful user feedback
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "AppleScript Support"
- Click Install
- Create or open an AppleScript file (
.applescriptor.scpt) - Write your script with full syntax highlighting and IntelliSense support
- Run the script by pressing
Cmd+Ror using the Command Palette (Cmd+Shift+P) → "Run AppleScript" - Run selected code by selecting text and pressing
Cmd+Shift+R
-- Simple AppleScript example
tell application "Finder"
display dialog "Hello from AppleScript!" buttons {"OK"} default button 1
beep 2
end tell| Command | Keyboard Shortcut | Description |
|---|---|---|
| Run AppleScript | Cmd+R |
Execute the current AppleScript file |
| Run Selected AppleScript | Cmd+Shift+R |
Execute only the selected code |
| Load AppleScript Dictionary | - | Load additional SDEF files for better IntelliSense |
The extension provides intelligent auto-completion for:
- Control structures:
if,then,else,repeat,while,try,on error - Common commands:
tell,display dialog,display notification,log,beep,delay - Data operations:
set,get,copy,property - Popular applications: Finder, System Events, Terminal
- Custom dictionaries: Load SDEF files for application-specific commands
Right-click in any AppleScript file to access:
- Run AppleScript
- Run Selected AppleScript (when text is selected)
Type these prefixes and press Tab to insert common patterns:
tell→ Tell application blockif→ If statementifelse→ If-else statementrepeat→ Repeat looptry→ Try-error blockdialog→ Display dialogshell→ Shell script commandon→ Handler (function)
- macOS (AppleScript is macOS-specific)
- VS Code 1.91.0 or higher
- osascript command (included with macOS)
No additional configuration required! The extension works out of the box with sensible defaults.
To enhance IntelliSense with application-specific commands:
- Use Command Palette (
Cmd+Shift+P) - Search for "Load AppleScript Dictionary"
- Select an SDEF file from an application bundle
- Syntax Highlighting for all AppleScript constructs
- Auto-closing pairs for parentheses, quotes, and block comments
- Smart indentation and formatting
- Comment toggling with
Cmd+/ - Block comments with
(*and*)
- Script execution requires saving untitled files first
- Large scripts may take a moment to execute
- Some application-specific commands require the target app to be installed
Contributions are welcome! Please read our Contributing Guide for details.
- Clone the repository
- Run
npm installto install dependencies - Press
F5in VS Code to launch the Extension Development Host - Run
npm testto execute unit tests - Use
npm run compileto build the extension - Create a
.vsixpackage withnpx vsce package
🎉 New Features:
- Enhanced IntelliSense with 25+ built-in AppleScript completions
- Improved error handling and user feedback
- Keyboard shortcuts (
Cmd+R,Cmd+Shift+R) - Context menu integration
- Better temporary file management
🔧 Improvements:
- Updated to modern VS Code APIs
- Comprehensive input validation
- Professional extension metadata
- Updated dependencies and security fixes
🛠️ Technical:
- Modern GitHub Actions workflows
- ESLint integration for code quality
- Automated security scanning
- Node.js LTS support
- Run selected AppleScript code
- Command to load additional dictionaries
- Basic syntax highlighting
- File icon support
- Run AppleScript command
- Preliminary dictionary-based completions
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
Made with ❤️ for the macOS automation community