emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [ANN] ob-applescript


From: Stig Brautaset
Subject: [O] [ANN] ob-applescript
Date: Fri, 16 Sep 2016 10:36:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]