Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stig/ob-applescript.el
AppleScript integration for Org Babel
https://github.com/stig/ob-applescript.el
Last synced: 12 days ago
JSON representation
AppleScript integration for Org Babel
- Host: GitHub
- URL: https://github.com/stig/ob-applescript.el
- Owner: stig
- Created: 2016-09-12T13:51:03.000Z (over 8 years ago)
- Default Branch: trunk
- Last Pushed: 2020-06-27T14:50:53.000Z (over 4 years ago)
- Last Synced: 2025-01-20T13:50:08.860Z (12 days ago)
- Language: Emacs Lisp
- Size: 7.81 KB
- Stars: 24
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
#+startup: showall
#+TITLE: AppleScript integration for Org BabelThis module lets you run AppleScript from AppleScript source code blocks
with Org Babel.This package is a direct result of attempting to answer a question on [[http://emacs.stackexchange.com/q/26374/10625][this
emacs.stackexchange.com thread]].* Some simple examples
No arguments, no code -- just return a string.
#+BEGIN_SRC org
,#+BEGIN_SRC applescript
"Hello World"
,#+END_SRC,#+RESULTS:
: Hello World
#+END_SRCYou can, however, pass a variable to a block:
#+BEGIN_SRC org
,#+BEGIN_SRC applescript :var subject="World"
"Hello " & subject
,#+END_SRC,#+RESULTS:
: Hello World
#+END_SRCYou can use either =apples= or =applescript= as the language designation, to
cater for two popular major modes. Use whichever you like. I prefer the
font-locking of the =apples= one. This example also shows you can do
interactive stuff.#+BEGIN_SRC org
,#+BEGIN_SRC apples
display alert "Danger! The WHAM is overheating!"
,#+END_SRC,#+RESULTS:
: button returned:OK
#+END_SRCIf the result of the evaluation looks like a table, it'll become a table:
#+BEGIN_SRC org
,#+BEGIN_SRC apples
"fi fo
1 2
3 4"
,#+END_SRC,#+RESULTS:
| fi | fo |
| 1 | 2 |
| 3 | 4 |
#+END_SRC* Installation
=M-x package-install RET ob-applescript RET=
Then, load the package from your =~/.emacs.d/init.el=:
#+BEGIN_SRC emacs-lisp
(require 'ob-applescript)
#+END_SRC* Ideas for future work (you're welcome to help!)
- =osascript= supports an interactive mode, which means I think it should be
possible to support =:session=.- Adding some tests.
- Adding some more documentation & examples.