forked from hhas/nodeautomation
-
Notifications
You must be signed in to change notification settings - Fork 0
macOS Apple event bridge for Node.js; 'master' is old, dead NodObjC-based branch; 'objc' is active WIP
License
Printfly/nodeautomation
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
# README
NodeAutomation is a Node.js module that allows 'AppleScriptable' applications
to be controlled directly from JavaScript.
For example, to get the value of the first paragraph of the document named
'README' in TextEdit:
app('TextEdit').documents.named('README').paragraphs[0].get()
This is equivalent to the AppleScript statement:
tell application "TextEdit" to get paragraph 1 of document "README"
Or to create a new "Hello World!" document in TextEdit:
app('TextEdit').make({new: k.document,
withProperties: {text: "Hello World!"}})
______________________________________________________________________________
Dependencies:
- objc -- https://github.com/hhas/objc (development fork)
______________________________________________________________________________
Caution: This is an alpha release. There will be bugs and rough edges.
Documentation is preliminary, being a quick and dirty translation of the
original appscript manual.
E&OE. No warranty given. Use at own risk. Etc.
(See also: http://appscript.sourceforge.net/status.html)
______________________________________________________________________________
Test:
$ node
> const {app} = require('nodeautomation')
> const finder = app('Finder')
> finder.home()
app('Finder').startupDisk.folders.named('Users').folders.named('jsmith')
______________________________________________________________________________
Known issues:
Parsing an application's dictionary is very slow; for now, use static glues
`util.inspect.custom` needs work (`Proxy` wrappers currently appear in REPL)
Relies on several now-deprecated CoreServices/Cocoa functions/methods for
which macOS does not provide replacements.About
macOS Apple event bridge for Node.js; 'master' is old, dead NodObjC-based branch; 'objc' is active WIP
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- JavaScript 97.7%
- Python 1.4%
- CSS 0.9%