Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yycoder/ts-jxa
Write JXA using typescript π!
https://github.com/yycoder/ts-jxa
applescript browserify jxa osascript typescript
Last synced: about 1 month ago
JSON representation
Write JXA using typescript π!
- Host: GitHub
- URL: https://github.com/yycoder/ts-jxa
- Owner: YYCoder
- Created: 2020-01-09T03:07:49.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-10T10:43:59.000Z (almost 5 years ago)
- Last Synced: 2024-01-27T03:04:14.534Z (11 months ago)
- Topics: applescript, browserify, jxa, osascript, typescript
- Language: TypeScript
- Homepage:
- Size: 10.7 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ts-jxa
[English](./docs/en.md) | [δΈζ](./docs/cn.md)Write JXA using typescript π!
Freely use ES features which typescript supports and provide nice basic development experience.
> Thanks to [JXA-Cookbook](https://github.com/JXA-Cookbook/JXA-Cookbook/wiki/Importing-Scripts).
### What is JXA?
It's OS X automation, using Javascript.Since OS X 10.10 (Yosemite), Javascript (called Javascript for Automation, or JXA) is also supported for app automation. This is great news, especially for Javascript developers who want to automate workflows on their Mac.
But by default, JXA only provides some primitive functionalities for development. For example, if you what to modularizing your code, the only way is [Using Script Library](https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/UseScriptLibraries.html#//apple_ref/doc/uid/TP40016239-CH36-SW1) which is apple officially recommended but it's cumbersome. And, you can't use any of your favorite node modules like lodash.
So, ts-jxa was born, aiming to make building JXA application more efficient and elegant.
### What is ts-jxa?
ts-jxa is a development tool for building JXA program.It let you use a lot of typescript features like arrow function/const && let/promise and most importantly, static type check.
And it gives you a nice development experience by auto rebuild, elegant output, and compression for production.
### Installation
`yarn add ts-jxa` or `npm i ts-jxa`If you want to install it globally, you can add global flag as follows:
`yarn global add ts-jxa` or `npm i -g ts-jxa`
### Other JXA resources
* [The JXA Cookbook](https://github.com/JXA-Cookbook/JXA-Cookbook/wiki#table-of-contents)* [Mac Automation Scripting Guide](https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/index.html#//apple_ref/doc/uid/TP40016239-CH56-SW1)
* [A Beginners Guide to JXA, JavaScript Application Scripting](https://computers.tutsplus.com/tutorials/a-beginners-guide-to-javascript-application-scripting-jxa--cms-27171)
* [Javascript for Automation Documentation](https://developer.apple.com/library/archive/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/OSX10-11.html#//apple_ref/doc/uid/TP40014508-CH110-SW1)