{"_id":"applescript","_rev":"4244860","name":"applescript","description":"Easily execute arbitrary AppleScript code on OS X through NodeJS.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2026-03-29T21:28:25.000Z","created":"2012-03-09T03:52:37.554Z","1.0.0":"2015-01-28T00:19:04.212Z","0.1.0":"2012-03-09T03:52:37.554Z","0.2.0":"2012-03-09T03:52:37.554Z","0.2.1":"2012-03-09T03:52:37.554Z"},"users":{},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"versions":{"1.0.0":{"name":"applescript","description":"Easily execute arbitrary AppleScript code on OS X through NodeJS.","version":"1.0.0","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"keywords":["applescript","mac","osx"],"main":"./lib/applescript","gitHead":"24c5b54cdff11a520b9c174584aca688393f7eca","_id":"applescript@1.0.0","scripts":{},"_shasum":"bb87af568cad034a4e48c4bdaf6067a3a2701317","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"bb87af568cad034a4e48c4bdaf6067a3a2701317","size":4963,"noattachment":false,"key":"/applescript/-/applescript-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/applescript/download/applescript-1.0.0.tgz"},"directories":{},"publish_time":1422404344212,"_hasShrinkwrap":false,"_cnpm_publish_time":1422404344212,"_cnpmcore_publish_time":"2021-12-17T01:49:36.461Z"},"0.1.0":{"name":"applescript","description":"Easily execute arbitrary AppleScript code on OS X through NodeJS.","version":"0.1.0","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"keywords":["applescript","mac","osx"],"main":"./lib/applescript","lib":"./lib","engines":{"node":">= 0.2.0"},"_id":"applescript@0.1.0","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"shasum":"b1d36dfda55141ec00fda52432110ee697f02d6a","size":4365,"noattachment":false,"key":"/applescript/-/applescript-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/applescript/download/applescript-0.1.0.tgz"},"directories":{},"publish_time":1331265157554,"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1331265157554,"_cnpmcore_publish_time":"2021-12-17T01:49:37.239Z"},"0.2.0":{"name":"applescript","description":"Easily execute arbitrary AppleScript code on OS X through NodeJS.","version":"0.2.0","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"keywords":["applescript","mac","osx"],"main":"./lib/applescript","lib":"./lib","engines":{"node":">= 0.2.0"},"_id":"applescript@0.2.0","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"shasum":"7325684b4ff5ca0e6e9e8b6218b8ec573c968c25","size":4965,"noattachment":false,"key":"/applescript/-/applescript-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/applescript/download/applescript-0.2.0.tgz"},"directories":{},"publish_time":1331265157554,"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1331265157554,"_cnpmcore_publish_time":"2021-12-17T01:49:37.025Z"},"0.2.1":{"name":"applescript","description":"Easily execute arbitrary AppleScript code on OS X through NodeJS.","version":"0.2.1","author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"keywords":["applescript","mac","osx"],"main":"./lib/applescript","lib":"./lib","engines":{"node":">= 0.2.0"},"_id":"applescript@0.2.1","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"shasum":"cbedbc5399006b0151cfdbbef560bfb491a4960e","size":4798,"noattachment":false,"key":"/applescript/-/applescript-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/applescript/download/applescript-0.2.1.tgz"},"directories":{},"publish_time":1331265157554,"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1331265157554,"_cnpmcore_publish_time":"2021-12-17T01:49:36.678Z"}},"readme":"node-applescript\n================\n\nA high-level way to execute AppleScript code through NodeJS, and retrieve\nthe result as a native JavaScript object. Underneath the hood, this\nmodule is just a simple wrapper around the OS X `osascript` command.\n\n### Why?\nAppleScripts are the only way to communicate and interact with certain\nexternal OS X processes, for example [iTunes](http://www.itunes.com).\n\nEasy Install\n------------\n\n``` bash\n$ npm install applescript\n```\n\nRequirements\n------------\n\n * Mac (or Hackintosh) running [OS X](http://www.apple.com/macosx) (tested with Snow Leopard)\n * [NodeJS](http://nodejs.org) (v0.2.0 or newer)\n\nUsage\n-----\n\nThe `node-applescript` module provides `execString` and `execFile` functions\nto easily execute AppleScript commands and buffer the output into a calback.\n\n``` js\nvar applescript = require('applescript');\n\n// Very basic AppleScript command. Returns the song name of each\n// currently selected track in iTunes as an 'Array' of 'String's.\nvar script = 'tell application \"iTunes\" to get name of selection';\n\napplescript.execString(script, function(err, rtn) {\n  if (err) {\n    // Something went wrong!\n  }\n  if (Array.isArray(rtn)) {\n    rtn.forEach(function(songName) {\n      console.log(songName);\n    });\n  }\n});\n```\n\n`execFile` works the exact same way, except you pass the _path_ of the AppleScript\n(`*.applescript`) file as the first argument instead of the command itself, and you\nmay pass an optional Array of String arguments to send to the applescript file.\n\nLicence\n-------\n\nThe `node-applescript` module is licensed under the MIT license, of course!\n","_attachments":{}}