Skip to content

Commit 14b0b25

Browse files
author
idleberg
committed
add JXA support
1 parent 37465e4 commit 14b0b25

File tree

6 files changed

+78
-3
lines changed

6 files changed

+78
-3
lines changed

.messages/jxa.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
v2.4.0
2+
======
3+
4+
This version adds language support and build-system for JavaScript for
5+
Automation (JXA).

AppleScript.sublime-build

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
2-
"selector": "source.applescript -source.applescript.binary",
2+
"selector": "source.js.jxa",
33
"cmd": [
44
"echo",
55
"Error: This build system only works on macOS"
66
],
77
"osx": {
88
"cmd": [
99
"/usr/bin/osacompile",
10+
"-l",
11+
"JavaScript",
1012
"-o",
1113
"$file_base_name.scpt",
1214
"$file"
@@ -18,6 +20,8 @@
1820
"osx": {
1921
"cmd": [
2022
"/usr/bin/osacompile",
23+
"-l",
24+
"JavaScript",
2125
"-o",
2226
"$file_base_name.scptd",
2327
"$file"
@@ -29,6 +33,8 @@
2933
"osx": {
3034
"cmd": [
3135
"/usr/bin/osacompile",
36+
"-l",
37+
"JavaScript",
3238
"-o",
3339
"$file_base_name.app",
3440
"$file"
@@ -40,6 +46,8 @@
4046
"osx": {
4147
"cmd": [
4248
"/usr/bin/osascript",
49+
"-l",
50+
"JavaScript",
4351
"$file"
4452
]
4553
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"selector": "source.applescript -source.applescript.binary",
3+
"cmd": [
4+
"echo",
5+
"Error: This build system only works on macOS"
6+
],
7+
"osx": {
8+
"cmd": [
9+
"/usr/bin/osacompile",
10+
"-o",
11+
"$file_base_name.scpt",
12+
"$file"
13+
]
14+
},
15+
"variants": [
16+
{
17+
"name": "Script bundle",
18+
"osx": {
19+
"cmd": [
20+
"/usr/bin/osacompile",
21+
"-o",
22+
"$file_base_name.scptd",
23+
"$file"
24+
]
25+
}
26+
},
27+
{
28+
"name": "Application",
29+
"osx": {
30+
"cmd": [
31+
"/usr/bin/osacompile",
32+
"-o",
33+
"$file_base_name.app",
34+
"$file"
35+
]
36+
}
37+
},
38+
{
39+
"name": "Run",
40+
"osx": {
41+
"cmd": [
42+
"/usr/bin/osascript",
43+
"$file"
44+
]
45+
}
46+
}
47+
]
48+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
%YAML 1.2
2+
---
3+
# http://www.sublimetext.com/docs/3/syntax.html
4+
name: JavaScript for Automation (JXA)
5+
comment: https://github.com/idleberg/ScummC-Sublime-Text
6+
file_extensions:
7+
- jxa
8+
- jxainc
9+
- js
10+
scope: source.js.jxa
11+
contexts:
12+
main:
13+
- include: scope:source.js.jxa

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GitHub](https://img.shields.io/github/release/idleberg/sublime-applescript.svg?style=flat-square)](https://github.com/idleberg/sublime-applescript/releases)
66
[![Travis](https://img.shields.io/travis/idleberg/sublime-applescript.svg?style=flat-square)](https://travis-ci.org/idleberg/sublime-applescript)
77

8-
This [Sublime Text](http://www.sublimetext.com/) package adds completions, snippets and build tools for [AppleScript](https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/introduction/ASLR_intro.html). As of version 2.0, this package also lets you edit binary script files.
8+
This [Sublime Text](http://www.sublimetext.com/) package adds completions, snippets and build tools for [AppleScript](https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/introduction/ASLR_intro.html) (including binary files) and JavaScript for Automation (JXA).
99

1010
![Screenshot](https://raw.github.com/idleberg/sublime-applescript/master/screenshot.gif)
1111

messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"2.0.0": ".messages/binary.txt",
3-
"2.2.1": ".messages/license-triggers.txt"
3+
"2.2.1": ".messages/license-triggers.txt",
4+
"2.4.0": ".messages/jxa.txt",
45
}

0 commit comments

Comments
 (0)