Code Monkey home page Code Monkey logo

sublime-applescript's Introduction

AppleScript Extensions for Sublime Text

The MIT License Package Control GitHub CircleCI

This Sublime Text package adds completions, snippets and build tools for AppleScript (including binary files) and JavaScript for Automation (JXA).

Screenshot

Screenshot of AppleScript in Sublime Text with Hopscotch color scheme

Installation

Package Control

  1. Make sure you already have Package Control installed
  2. Choose “Install Package” from the Command Palette (Super+Shift+p)
  3. Select “AppleScript Extensions”” and press Enter

Using Git

  1. Change to your Sublime Text Packages directory
  2. Clone repository git clone https://github.com/idleberg/sublime-applescript.git 'AppleScript Extensions'

Manual installation

  1. Download the latest stable release
  2. Unzip the archive to your Sublime Text Packages directory

Usage

Completions

Many commands can simply be triggered by completing a standard AppleScript command. Commands such as try, if, repeat, or set will create a code block. Press Tab to jump between input-fields.

Snippets

There are several snippets included to generate license-texts enclosed in a comment. To trigger these, try the license command with license names as parameter. You could, for example, use license:mit to add an MIT License text, or license:gpl2 for the GNU General Public License in version 2.0. Press Tab to jump between input-fields.

You can directly address several macOS applications to have them perform some action. For instance you can scaffold a script using Mail:Send message, telling Mail to send a message. You can use Tab to jump between recipient, subject and message fields. Other examples would be System Preferences:Security to open the according panel in System Preferences, or iTunes:Open file to play a piece of music in iTunes.

More examples:

  • Calendar:Add event
  • Finder:Open location
  • OS:Notification Message
  • Safari:Open location
  • Terminal:Run shell script

Build System

Build systems are available on macOS to compile or run scripts. Use the default shortcut +B to build or Shift++B to select a build system variant.

Note: When editing binary AppleScripts decompiled by this package, you can simply save the file for it to be re-compiled. Building it will lead to undesired results.

License

This work is licensed under the The MIT License.

sublime-applescript's People

Contributors

bitdeli-chef avatar dvcrn avatar idleberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

theironborn dvcrn

sublime-applescript's Issues

Error loading syntax on startup

Hi, I'm getting this error right after installing the package when trying to set the syntax to jxa:

Error loading syntax file "Packages/AppleScript Extensions/JavaScript for Automation (JXA).sublime-syntax": stack overflow, it's likely there's an include loop

applescript build changes file to binary

When I build a script the file view changes to binary. I don't see a way of getting back the source code short of closing and reopening the file. ST3 on OS X 10.11.6.

'Building...' message in status bar

As soon as I open a .scpt file the status bar message changes to "Saving as Binary Property List". No saving is going on and the message doesn't go away. ST3 on OS X 10.11.6.

Sorry for bombarding you with these issues. Having them separate makes it easier, I think.

edited files not "dirty"

When I edit a .scpt file there is no indication that the file contains unsaved changes. The file tab has the x glyph, not the filled o circle. This is only with scpt files; no issue with others. I'm using ST3 on OS X 10.11.6.

Syntax highlighting does not cover the entire file

I have a fairly large handler library I used for resizing windows and I noticed that the syntax highlighting does not cover the entire file. In addition, those handlers that are not highlighted do not appear in the list when I trigger the goto Symbol.

A large library is probably a bad idea and should be refactored, but in the meantime, it might be simpler not to have this limitation?

My library is 1004 lines with comments, inline unit tests.

Incessantly displays dialogs about binary files when used in windows

After adding the functionality to decode binary files on Mac, the plugin displays a dialog saying that you can only view binary files on mac every time you open a file, regardless of the file type.

For example, I was opening a php file and it kept bugging me. I had to disable the plugin to get it to stop.

Nothing works in ST3

I don't know if it's simply a ST2 vs 3 thing, or if there's something I'm missing, but I can't get anything to work in ST3.

Removes Applescript Package after Install

I'm installing via Package Control. After install I'm not able to select applescript as language. Is this intended?

For anyone else not wanting this behavior backup /Library/Application Support/Sublime Text 3 before install.

OSX 10.10.2
Sublime (3065)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.