Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

readme++

  • Loading branch information...
commit 27ac532131da3f25ba779873e55c26ca6959ecaa 1 parent 7cb5752
Nathan Rajlich authored January 14, 2013

Showing 1 changed file with 20 additions and 16 deletions. Show diff stats Hide diff stats

  1. 36  README.md
36  README.md
Source Rendered
@@ -12,7 +12,9 @@ external OS X processes, for example [iTunes](http://www.itunes.com).
12 12
 Easy Install
13 13
 ------------
14 14
 
15  
-    npm install applescript
  15
+``` bash
  16
+$ npm install applescript
  17
+```
16 18
 
17 19
 Requirements
18 20
 ------------
@@ -26,22 +28,24 @@ Usage
26 28
 The `node-applescript` module provides `execString` and `execFile` functions
27 29
 to easily execute AppleScript commands and buffer the output into a calback.
28 30
 
29  
-    var applescript = require("applescript");
30  
-    
31  
-    // Very basic AppleScript command. Returns the song name of each
32  
-    // currently selected track in iTunes as an 'Array' of 'String's.
33  
-    var script = 'tell application "iTunes" to get name of selection';
34  
-    
35  
-    applescript.execString(script, function(err, rtn) {
36  
-      if (err) {
37  
-        // Something went wrong!
38  
-      }
39  
-      if (Array.isArray(rtn)) {
40  
-        rtn.forEach(function(songName) {
41  
-          console.log(songName);
42  
-        });
43  
-      }
  31
+``` js
  32
+var applescript = require("applescript");
  33
+
  34
+// Very basic AppleScript command. Returns the song name of each
  35
+// currently selected track in iTunes as an 'Array' of 'String's.
  36
+var script = 'tell application "iTunes" to get name of selection';
  37
+
  38
+applescript.execString(script, function(err, rtn) {
  39
+  if (err) {
  40
+    // Something went wrong!
  41
+  }
  42
+  if (Array.isArray(rtn)) {
  43
+    rtn.forEach(function(songName) {
  44
+      console.log(songName);
44 45
     });
  46
+  }
  47
+});
  48
+```
45 49
 
46 50
 `execFile` works the exact same way, except you pass the _path_ of the AppleScript
47 51
 (`*.applescript`) file as the first argument instead of the command itself, and you

0 notes on commit 27ac532

Please sign in to comment.
Something went wrong with that request. Please try again.