Skip to content
/ osa Public

Emacs Lisp to Open Scripting Architecture (AppleScript / JavaScript) bridge

License

Notifications You must be signed in to change notification settings

atomontage/osa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://img.shields.io/badge/license-BSD-blue.svg https://melpa.org/packages/osa-badge.svg

osa.el is an Emacs Lisp to macOS Open Scripting Architecture bridge (JavaScript / AppleScript) working on top of Apple Event descriptors as provided by Emacs Mac port.

Features

All of the necessary Apple Event types that are needed to write useful scripts are supported for both packing and unpacking:

  • True is unpacked to t
  • False is unpacked to nil
  • Boolean is unpacked to t or nil
  • Long is unpacked from signed 32bit to Emacs Lisp integer
  • Null which is distinct from null type, is unpacked to keyword :null
  • Type is unpacked to either (:type :null), (:type :msng), (:type data)
  • Unicode text (UTF-16 BOM auto-detection)
  • List is unpacked to Emacs Lisp vector
  • Record is unpacked to an Emacs Lisp tagged alist: (:reco (k . v) ..)

Conversely for packing, except t and nil are always packed to True and False (never a Boolean type) and tagged (:list ..) is packed like a vector.

Additional types may be implemented in future releases.

Note

Does not work with official GNU Emacs for macOS (or emacsformacosx.com) as it does not expose an Apple Event API.

You need Yamamoto Mitsuharu’s excellent Emacs Mac port, which can also be found in MacPorts and Homebrew, though cloning its repository and building from source is highly recommended.

Install

Simple and most flexible method:

;; Clone this repository, ensure directory of osa.el is in your
;; load-path and add the following to your init file:
(require 'osa-examples)

Alternatively, you can install through MELPA or some other Emacs package manager.

Usage

See osa-examples.el

License

This repository uses 2 different licenses:

  • All files in the ‘scripts’ directory use a public-domain equivalent license
  • All other files use a 2-clause BSD license

Author

xristos (AT) sdf (DOT) org

About

Emacs Lisp to Open Scripting Architecture (AppleScript / JavaScript) bridge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published