emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stig Brautaset <stig@brautaset.org>
To: emacs-orgmode@gnu.org
Subject: [ANN] ob-applescript
Date: Fri, 16 Sep 2016 10:36:12 +0100	[thread overview]
Message-ID: <m0fup0i3ub.fsf@brautaset.org> (raw)


I've just made `ob-applescript', a backend to execute AppleScript from
Org Babel source code blocks available on Melpa. It's my first attempt
at making a babel backend, so any comments and criticism welcome. Here
are some things it does support though:

- No arguments, no code – just return a string.

    #+BEGIN_SRC applescript
      "Hello World"
    #+END_SRC
    
    #+RESULTS:
    : Hello World

- You can pass variable to a block:

    #+BEGIN_SRC applescript :var subject="World"
      "Hello " & subject
    #+END_SRC
    
    #+RESULTS:
    : Hello World

- You can use either apples or applescript as the language designation,
  to cater for two competing major modes. This example also shows you
  can do interactive stuff.
  
    #+BEGIN_SRC apples
    display alert "Danger! The WHAM is overheating!"
    #+END_SRC
    
    #+RESULTS:
    : button returned:OK
    
- If the result of the evaluation looks like a table, it’ll become a table:

    #+BEGIN_SRC apples
    "fi fo
    1 2
    3 4"
    #+END_SRC
    
    #+RESULTS:
    | fi | fo |
    |  1 |  2 |
    |  3 |  4 |

Hope this is useful to someone!

Stig

             reply	other threads:[~2016-09-16  9:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16  9:36 Stig Brautaset [this message]
2016-09-16 16:00 ` [ANN] ob-applescript Nick Dokos
2016-09-16 16:01 ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0fup0i3ub.fsf@brautaset.org \
    --to=stig@brautaset.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).