{"id":16486503,"url":"https://github.com/lucasbento/node-applescript-promise","last_synced_at":"2025-03-23T12:33:29.039Z","repository":{"id":57182853,"uuid":"101641091","full_name":"lucasbento/node-applescript-promise","owner":"lucasbento","description":"Easily execute arbitrary AppleScript code on OS X through NodeJS with Promises.","archived":false,"fork":false,"pushed_at":"2017-08-30T13:30:06.000Z","size":43,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-18T09:19:40.755Z","etag":null,"topics":["applescript","javascript","mac","node","nodejs","npm","osascript","osx","promise"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucasbento.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-28T12:30:31.000Z","updated_at":"2024-09-17T10:25:00.000Z","dependencies_parsed_at":"2022-09-11T22:40:50.394Z","dependency_job_id":null,"html_url":"https://github.com/lucasbento/node-applescript-promise","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbento%2Fnode-applescript-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbento%2Fnode-applescript-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbento%2Fnode-applescript-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbento%2Fnode-applescript-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasbento","download_url":"https://codeload.github.com/lucasbento/node-applescript-promise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221850863,"owners_count":16891683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applescript","javascript","mac","node","nodejs","npm","osascript","osx","promise"],"created_at":"2024-10-11T13:29:29.990Z","updated_at":"2024-10-28T15:49:42.522Z","avatar_url":"https://github.com/lucasbento.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-applescript-promise [![Build Status](https://travis-ci.org/lucasbento/node-applescript-promise.svg?branch=master)](https://travis-ci.org/lucasbento/node-applescript-promise)\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```sh\nyarn add applescript-promise\n```\n\nRequirements\n------------\n\n * Mac (or Hackintosh) running [OS X](http://www.apple.com/macosx) (tested with Sierra)\n * [NodeJS](http://nodejs.org) (v4.4.7 or newer)\n\nUsage\n-----\n\nThe `node-applescript-promise` module provides `execString` and `execFile` functions\nto easily execute AppleScript commands and buffer the output into a calback.\n\n```js\nimport applescript from '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.\n\nconst script = 'tell application \"iTunes\" to get name of selection';\n\napplescript.execString(script)\n  .then((tracks) =\u003e {\n    tracks.forEach(songName =\u003e console.log(songName);\n  })\n  .catch((error) =\u003e {\n    // Something went wrong\n    console.log('error:', error);\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 strings as a second argument to send to the applescript file.\n\nLicense\n-------\n\nThe `node-applescript-promise` module is licensed under the MIT license.\n\nThis module is a merely wrapper over [node-applescript](https://github.com/TooTallNate/node-applescript/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasbento%2Fnode-applescript-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasbento%2Fnode-applescript-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasbento%2Fnode-applescript-promise/lists"}