PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.5
Code Block Pro – Beautiful Syntax Highlighting v1.27.5
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / applescript.tmLanguage.json

applescript.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.27.5, at build/shiki/languages/applescript.tmLanguage.json

1,404 lines 46.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "fileTypes": ["applescript", "scpt", "script editor"],
3 "firstLineMatch": "^#!.*(osascript)",
4 "keyEquivalent": "^~A",
5 "name": "applescript",
6 "patterns": [
7 {
8 "include": "#blocks"
9 },
10 {
11 "include": "#inline"
12 }
13 ],
14 "repository": {
15 "attributes.considering-ignoring": {
16 "patterns": [
17 {
18 "match": ",",
19 "name": "punctuation.separator.array.attributes.applescript"
20 },
21 {
22 "match": "\\b(and)\\b",
23 "name": "keyword.control.attributes.and.applescript"
24 },
25 {
26 "match": "\\b(?i:case|diacriticals|hyphens|numeric\\s+strings|punctuation|white\\s+space)\\b",
27 "name": "constant.other.attributes.text.applescript"
28 },
29 {
30 "match": "\\b(?i:application\\s+responses)\\b",
31 "name": "constant.other.attributes.application.applescript"
32 }
33 ]
34 },
35 "blocks": {
36 "patterns": [
37 {
38 "begin": "^\\s*(script)\\s+(\\w+)",
39 "beginCaptures": {
40 "1": {
41 "name": "keyword.control.script.applescript"
42 },
43 "2": {
44 "name": "entity.name.type.script-object.applescript"
45 }
46 },
47 "end": "^\\s*(end(?:\\s+script)?)(?=\\s*(--.*?)?$)",
48 "endCaptures": {
49 "1": {
50 "name": "keyword.control.script.applescript"
51 }
52 },
53 "name": "meta.block.script.applescript",
54 "patterns": [
55 {
56 "include": "$self"
57 }
58 ]
59 },
60 {
61 "begin": "^(?x)\n\t\t\t\t\t\t\\s*(to|on)\\s+ \t\t\t\t\t# \"on\" or \"to\"\n\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t\t# function name\n\t\t\t\t\t\t(\\()\t\t\t\t\t\t\t# opening paren\n\t\t\t\t\t\t\t((?:[\\s,:\\{\\}]*(?:\\w+)?)*)\t# parameters\n\t\t\t\t\t\t(\\))\t\t\t\t\t\t\t# closing paren\n\t\t\t\t\t",
62 "beginCaptures": {
63 "1": {
64 "name": "keyword.control.function.applescript"
65 },
66 "2": {
67 "name": "entity.name.function.handler.applescript"
68 },
69 "3": {
70 "name": "punctuation.definition.parameters.begin.applescript"
71 },
72 "4": {
73 "name": "variable.parameter.handler.applescript"
74 },
75 "5": {
76 "name": "punctuation.definition.parameters.end.applescript"
77 }
78 },
79 "comment": "\n\t\t\t\t\t\tThis is not a very well-designed rule. For now,\n\t\t\t\t\t\twe can leave it like this though, as it sorta works.\n\t\t\t\t\t",
80 "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)",
81 "endCaptures": {
82 "1": {
83 "name": "keyword.control.function.applescript"
84 }
85 },
86 "name": "meta.function.positional.applescript",
87 "patterns": [
88 {
89 "include": "$self"
90 }
91 ]
92 },
93 {
94 "begin": "^(?x)\n\t\t\t\t\t\t\\s*(to|on)\\s+ \t\t\t\t\t# \"on\" or \"to\"\n\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t\t# function name\n\t\t\t\t\t\t(?:\\s+\n\t\t\t\t\t\t\t(of|in)\\s+\t\t\t\t\t# \"of\" or \"in\"\n\t\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t# direct parameter\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t(?=\\s+(above|against|apart\\s+from|around|aside\\s+from|at|below|beneath|beside|between|by|for|from|instead\\s+of|into|on|onto|out\\s+of|over|thru|under)\\b)\n\t\t\t\t\t",
95 "beginCaptures": {
96 "1": {
97 "name": "keyword.control.function.applescript"
98 },
99 "2": {
100 "name": "entity.name.function.handler.applescript"
101 },
102 "3": {
103 "name": "keyword.control.function.applescript"
104 },
105 "4": {
106 "name": "variable.parameter.handler.direct.applescript"
107 }
108 },
109 "comment": "TODO: match `given` parameters",
110 "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)",
111 "endCaptures": {
112 "1": {
113 "name": "keyword.control.function.applescript"
114 }
115 },
116 "name": "meta.function.prepositional.applescript",
117 "patterns": [
118 {
119 "captures": {
120 "1": {
121 "name": "keyword.control.preposition.applescript"
122 },
123 "2": {
124 "name": "variable.parameter.handler.applescript"
125 }
126 },
127 "match": "\\b(?i:above|against|apart\\s+from|around|aside\\s+from|at|below|beneath|beside|between|by|for|from|instead\\s+of|into|on|onto|out\\s+of|over|thru|under)\\s+(\\w+)\\b"
128 },
129 {
130 "include": "$self"
131 }
132 ]
133 },
134 {
135 "begin": "^(?x)\n\t\t\t\t\t\t\\s*(to|on)\\s+ \t\t\t\t\t# \"on\" or \"to\"\n\t\t\t\t\t\t(\\w+)\t\t\t\t\t\t\t# function name\n\t\t\t\t\t\t(?=\\s*(--.*?)?$)\t\t\t\t# nothing else\n\t\t\t\t\t",
136 "beginCaptures": {
137 "1": {
138 "name": "keyword.control.function.applescript"
139 },
140 "2": {
141 "name": "entity.name.function.handler.applescript"
142 }
143 },
144 "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)",
145 "endCaptures": {
146 "1": {
147 "name": "keyword.control.function.applescript"
148 }
149 },
150 "name": "meta.function.parameterless.applescript",
151 "patterns": [
152 {
153 "include": "$self"
154 }
155 ]
156 },
157 {
158 "include": "#blocks.tell"
159 },
160 {
161 "include": "#blocks.repeat"
162 },
163 {
164 "include": "#blocks.statement"
165 },
166 {
167 "include": "#blocks.other"
168 }
169 ]
170 },
171 "blocks.other": {
172 "patterns": [
173 {
174 "begin": "^\\s*(considering)\\b",
175 "end": "^\\s*(end(?:\\s+considering)?)(?=\\s*(--.*?)?$)",
176 "name": "meta.block.considering.applescript",
177 "patterns": [
178 {
179 "begin": "(?<=considering)",
180 "end": "(?<!¬)$",
181 "name": "meta.array.attributes.considering.applescript",
182 "patterns": [
183 {
184 "include": "#attributes.considering-ignoring"
185 }
186 ]
187 },
188 {
189 "begin": "(?<=ignoring)",
190 "end": "(?<!¬)$",
191 "name": "meta.array.attributes.ignoring.applescript",
192 "patterns": [
193 {
194 "include": "#attributes.considering-ignoring"
195 }
196 ]
197 },
198 {
199 "match": "\\b(but)\\b",
200 "name": "keyword.control.but.applescript"
201 },
202 {
203 "include": "$self"
204 }
205 ]
206 },
207 {
208 "begin": "^\\s*(ignoring)\\b",
209 "end": "^\\s*(end(?:\\s+ignoring)?)(?=\\s*(--.*?)?$)",
210 "name": "meta.block.ignoring.applescript",
211 "patterns": [
212 {
213 "begin": "(?<=considering)",
214 "end": "(?<!¬)$",
215 "name": "meta.array.attributes.considering.applescript",
216 "patterns": [
217 {
218 "include": "#attributes.considering-ignoring"
219 }
220 ]
221 },
222 {
223 "begin": "(?<=ignoring)",
224 "end": "(?<!¬)$",
225 "name": "meta.array.attributes.ignoring.applescript",
226 "patterns": [
227 {
228 "include": "#attributes.considering-ignoring"
229 }
230 ]
231 },
232 {
233 "match": "\\b(but)\\b",
234 "name": "keyword.control.but.applescript"
235 },
236 {
237 "include": "$self"
238 }
239 ]
240 },
241 {
242 "begin": "^\\s*(if)\\b",
243 "beginCaptures": {
244 "1": {
245 "name": "keyword.control.if.applescript"
246 }
247 },
248 "end": "^\\s*(end(?:\\s+if)?)(?=\\s*(--.*?)?$)",
249 "endCaptures": {
250 "1": {
251 "name": "keyword.control.end.applescript"
252 }
253 },
254 "name": "meta.block.if.applescript",
255 "patterns": [
256 {
257 "match": "\\b(then)\\b",
258 "name": "keyword.control.then.applescript"
259 },
260 {
261 "match": "\\b(else\\s+if)\\b",
262 "name": "keyword.control.else-if.applescript"
263 },
264 {
265 "match": "\\b(else)\\b",
266 "name": "keyword.control.else.applescript"
267 },
268 {
269 "include": "$self"
270 }
271 ]
272 },
273 {
274 "begin": "^\\s*(try)\\b",
275 "beginCaptures": {
276 "1": {
277 "name": "keyword.control.try.applescript"
278 }
279 },
280 "end": "^\\s*(end(?:\\s+(try|error))?)(?=\\s*(--.*?)?$)",
281 "endCaptures": {
282 "1": {
283 "name": "keyword.control.end.applescript"
284 }
285 },
286 "name": "meta.block.try.applescript",
287 "patterns": [
288 {
289 "begin": "^\\s*(on\\s+error)\\b",
290 "beginCaptures": {
291 "1": {
292 "name": "keyword.control.exception.on-error.applescript"
293 }
294 },
295 "end": "(?<!¬)$",
296 "name": "meta.property.error.applescript",
297 "patterns": [
298 {
299 "match": "\\b(?i:number|partial|from|to)\\b",
300 "name": "keyword.control.exception.modifier.applescript"
301 },
302 {
303 "include": "#inline"
304 }
305 ]
306 },
307 {
308 "include": "$self"
309 }
310 ]
311 },
312 {
313 "begin": "^\\s*(using\\s+terms\\s+from)\\b",
314 "beginCaptures": {
315 "1": {
316 "name": "keyword.control.terms.applescript"
317 }
318 },
319 "end": "^\\s*(end(?:\\s+using\\s+terms\\s+from)?)(?=\\s*(--.*?)?$)",
320 "endCaptures": {
321 "1": {
322 "name": "keyword.control.end.applescript"
323 }
324 },
325 "name": "meta.block.terms.applescript",
326 "patterns": [
327 {
328 "include": "$self"
329 }
330 ]
331 },
332 {
333 "begin": "^\\s*(with\\s+timeout(\\s+of)?)\\b",
334 "beginCaptures": {
335 "1": {
336 "name": "keyword.control.timeout.applescript"
337 }
338 },
339 "end": "^\\s*(end(?:\\s+timeout)?)(?=\\s*(--.*?)?$)",
340 "endCaptures": {
341 "1": {
342 "name": "keyword.control.end.applescript"
343 }
344 },
345 "name": "meta.block.timeout.applescript",
346 "patterns": [
347 {
348 "include": "$self"
349 }
350 ]
351 },
352 {
353 "begin": "^\\s*(with\\s+transaction(\\s+of)?)\\b",
354 "beginCaptures": {
355 "1": {
356 "name": "keyword.control.transaction.applescript"
357 }
358 },
359 "end": "^\\s*(end(?:\\s+transaction)?)(?=\\s*(--.*?)?$)",
360 "endCaptures": {
361 "1": {
362 "name": "keyword.control.end.applescript"
363 }
364 },
365 "name": "meta.block.transaction.applescript",
366 "patterns": [
367 {
368 "include": "$self"
369 }
370 ]
371 }
372 ]
373 },
374 "blocks.repeat": {
375 "patterns": [
376 {
377 "begin": "^\\s*(repeat)\\s+(until)\\b",
378 "beginCaptures": {
379 "1": {
380 "name": "keyword.control.repeat.applescript"
381 },
382 "2": {
383 "name": "keyword.control.until.applescript"
384 }
385 },
386 "end": "^\\s*(end(?:\\s+repeat)?)(?=\\s*(--.*?)?$)",
387 "endCaptures": {
388 "1": {
389 "name": "keyword.control.end.applescript"
390 }
391 },
392 "name": "meta.block.repeat.until.applescript",
393 "patterns": [
394 {
395 "include": "$self"
396 }
397 ]
398 },
399 {
400 "begin": "^\\s*(repeat)\\s+(while)\\b",
401 "beginCaptures": {
402 "1": {
403 "name": "keyword.control.repeat.applescript"
404 },
405 "2": {
406 "name": "keyword.control.while.applescript"
407 }
408 },
409 "end": "^\\s*(end(?:\\s+repeat)?)(?=\\s*(--.*?)?$)",
410 "endCaptures": {
411 "1": {
412 "name": "keyword.control.end.applescript"
413 }
414 },
415 "name": "meta.block.repeat.while.applescript",
416 "patterns": [
417 {
418 "include": "$self"
419 }
420 ]
421 },
422 {
423 "begin": "^\\s*(repeat)\\s+(with)\\s+(\\w+)\\b",
424 "beginCaptures": {
425 "1": {
426 "name": "keyword.control.repeat.applescript"
427 },
428 "2": {
429 "name": "keyword.control.until.applescript"
430 },
431 "3": {
432 "name": "variable.parameter.loop.applescript"
433 }
434 },
435 "end": "^\\s*(end(?:\\s+repeat)?)(?=\\s*(--.*?)?$)",
436 "endCaptures": {
437 "1": {
438 "name": "keyword.control.end.applescript"
439 }
440 },
441 "name": "meta.block.repeat.with.applescript",
442 "patterns": [
443 {
444 "match": "\\b(from|to|by)\\b",
445 "name": "keyword.control.modifier.range.applescript"
446 },
447 {
448 "match": "\\b(in)\\b",
449 "name": "keyword.control.modifier.list.applescript"
450 },
451 {
452 "include": "$self"
453 }
454 ]
455 },
456 {
457 "begin": "^\\s*(repeat)\\b(?=\\s*(--.*?)?$)",
458 "beginCaptures": {
459 "1": {
460 "name": "keyword.control.repeat.applescript"
461 }
462 },
463 "end": "^\\s*(end(?:\\s+repeat)?)(?=\\s*(--.*?)?$)",
464 "endCaptures": {
465 "1": {
466 "name": "keyword.control.end.applescript"
467 }
468 },
469 "name": "meta.block.repeat.forever.applescript",
470 "patterns": [
471 {
472 "include": "$self"
473 }
474 ]
475 },
476 {
477 "begin": "^\\s*(repeat)\\b",
478 "beginCaptures": {
479 "1": {
480 "name": "keyword.control.repeat.applescript"
481 }
482 },
483 "end": "^\\s*(end(?:\\s+repeat)?)(?=\\s*(--.*?)?$)",
484 "endCaptures": {
485 "1": {
486 "name": "keyword.control.end.applescript"
487 }
488 },
489 "name": "meta.block.repeat.times.applescript",
490 "patterns": [
491 {
492 "match": "\\b(times)\\b",
493 "name": "keyword.control.times.applescript"
494 },
495 {
496 "include": "$self"
497 }
498 ]
499 }
500 ]
501 },
502 "blocks.statement": {
503 "patterns": [
504 {
505 "begin": "\\b(prop(?:erty)?)\\s+(\\w+)\\b",
506 "beginCaptures": {
507 "1": {
508 "name": "keyword.control.def.property.applescript"
509 },
510 "2": {
511 "name": "variable.other.property.applescript"
512 }
513 },
514 "end": "(?<!¬)$",
515 "name": "meta.statement.property.applescript",
516 "patterns": [
517 {
518 "match": ":",
519 "name": "punctuation.separator.key-value.property.applescript"
520 },
521 {
522 "include": "#inline"
523 }
524 ]
525 },
526 {
527 "begin": "\\b(set)\\s+(\\w+)\\s+(to)\\b",
528 "beginCaptures": {
529 "1": {
530 "name": "keyword.control.def.set.applescript"
531 },
532 "2": {
533 "name": "variable.other.readwrite.set.applescript"
534 },
535 "3": {
536 "name": "keyword.control.def.set.applescript"
537 }
538 },
539 "end": "(?<!¬)$",
540 "name": "meta.statement.set.applescript",
541 "patterns": [
542 {
543 "include": "#inline"
544 }
545 ]
546 },
547 {
548 "begin": "\\b(local)\\b",
549 "beginCaptures": {
550 "1": {
551 "name": "keyword.control.def.local.applescript"
552 }
553 },
554 "end": "(?<!¬)$",
555 "name": "meta.statement.local.applescript",
556 "patterns": [
557 {
558 "match": ",",
559 "name": "punctuation.separator.variables.local.applescript"
560 },
561 {
562 "match": "\\b\\w+",
563 "name": "variable.other.readwrite.local.applescript"
564 },
565 {
566 "include": "#inline"
567 }
568 ]
569 },
570 {
571 "begin": "\\b(global)\\b",
572 "beginCaptures": {
573 "1": {
574 "name": "keyword.control.def.global.applescript"
575 }
576 },
577 "end": "(?<!¬)$",
578 "name": "meta.statement.global.applescript",
579 "patterns": [
580 {
581 "match": ",",
582 "name": "punctuation.separator.variables.global.applescript"
583 },
584 {
585 "match": "\\b\\w+",
586 "name": "variable.other.readwrite.global.applescript"
587 },
588 {
589 "include": "#inline"
590 }
591 ]
592 },
593 {
594 "begin": "\\b(error)\\b",
595 "beginCaptures": {
596 "1": {
597 "name": "keyword.control.exception.error.applescript"
598 }
599 },
600 "end": "(?<!¬)$",
601 "name": "meta.statement.error.applescript",
602 "patterns": [
603 {
604 "match": "\\b(number|partial|from|to)\\b",
605 "name": "keyword.control.exception.modifier.applescript"
606 },
607 {
608 "include": "#inline"
609 }
610 ]
611 },
612 {
613 "begin": "\\b(if)\\b(?=.*\\bthen\\b(?!\\s*(--.*?)?$))",
614 "beginCaptures": {
615 "1": {
616 "name": "keyword.control.if.applescript"
617 }
618 },
619 "end": "(?<!¬)$",
620 "name": "meta.statement.if-then.applescript",
621 "patterns": [
622 {
623 "include": "#inline"
624 }
625 ]
626 }
627 ]
628 },
629 "blocks.tell": {
630 "patterns": [
631 {
632 "begin": "^\\s*(tell)\\s+(?=app(lication)?\\s+\"(?i:textmate)\")(?!.*\\bto(?!\\s+tell)\\b)",
633 "captures": {
634 "1": {
635 "name": "keyword.control.tell.applescript"
636 }
637 },
638 "comment": "tell Textmate",
639 "end": "^\\s*(end(?:\\s+tell)?)(?=\\s*(--.*?)?$)",
640 "name": "meta.block.tell.application.textmate.applescript",
641 "patterns": [
642 {
643 "include": "#textmate"
644 },
645 {
646 "include": "#standard-suite"
647 },
648 {
649 "include": "$self"
650 }
651 ]
652 },
653 {
654 "begin": "^\\s*(tell)\\s+(?=app(lication)?\\s+\"(?i:finder)\")(?!.*\\bto(?!\\s+tell)\\b)",
655 "captures": {
656 "1": {
657 "name": "keyword.control.tell.applescript"
658 }
659 },
660 "comment": "tell Finder",
661 "end": "^\\s*(end(?:\\s+tell)?)(?=\\s*(--.*?)?$)",
662 "name": "meta.block.tell.application.finder.applescript",
663 "patterns": [
664 {
665 "include": "#finder"
666 },
667 {
668 "include": "#standard-suite"
669 },
670 {
671 "include": "$self"
672 }
673 ]
674 },
675 {
676 "begin": "^\\s*(tell)\\s+(?=app(lication)?\\s+\"(?i:system events)\")(?!.*\\bto(?!\\s+tell)\\b)",
677 "captures": {
678 "1": {
679 "name": "keyword.control.tell.applescript"
680 }
681 },
682 "comment": "tell System Events",
683 "end": "^\\s*(end(?:\\s+tell)?)(?=\\s*(--.*?)?$)",
684 "name": "meta.block.tell.application.system-events.applescript",
685 "patterns": [
686 {
687 "include": "#system-events"
688 },
689 {
690 "include": "#standard-suite"
691 },
692 {
693 "include": "$self"
694 }
695 ]
696 },
697 {
698 "begin": "^\\s*(tell)\\s+(?=app(lication)?\\s+\"(?i:itunes)\")(?!.*\\bto(?!\\s+tell)\\b)",
699 "captures": {
700 "1": {
701 "name": "keyword.control.tell.applescript"
702 }
703 },
704 "comment": "tell iTunes",
705 "end": "^\\s*(end(?:\\s+tell)?)(?=\\s*(--.*?)?$)",
706 "name": "meta.block.tell.application.itunes.applescript",
707 "patterns": [
708 {
709 "include": "#itunes"
710 },
711 {
712 "include": "#standard-suite"
713 },
714 {
715 "include": "$self"
716 }
717 ]
718 },
719 {
720 "begin": "^\\s*(tell)\\s+(?=app(lication)?\\s+process\\b)(?!.*\\bto(?!\\s+tell)\\b)",
721 "captures": {
722 "1": {
723 "name": "keyword.control.tell.applescript"
724 }
725 },
726 "comment": "tell generic application process",
727 "end": "^\\s*(end(?:\\s+tell)?)(?=\\s*(--.*?)?$)",
728 "name": "meta.block.tell.application-process.generic.applescript",
729 "patterns": [
730 {
731 "include": "#standard-suite"
732 },
733 {
734 "include": "$self"
735 }
736 ]
737 },
738 {
739 "begin": "^\\s*(tell)\\s+(?=app(lication)?\\b)(?!.*\\bto(?!\\s+tell)\\b)",
740 "captures": {
741 "1": {
742 "name": "keyword.control.tell.applescript"
743 }
744 },
745 "comment": "tell generic application",
746 "end": "^\\s*(end(?:\\s+tell)?)(?=\\s*(--.*?)?$)",
747 "name": "meta.block.tell.application.generic.applescript",
748 "patterns": [
749 {
750 "include": "#standard-suite"
751 },
752 {
753 "include": "$self"
754 }
755 ]
756 },
757 {
758 "begin": "^\\s*(tell)\\s+(?!.*\\bto(?!\\s+tell)\\b)",
759 "captures": {
760 "1": {
761 "name": "keyword.control.tell.applescript"
762 }
763 },
764 "comment": "generic tell block",
765 "end": "^\\s*(end(?:\\s+tell)?)(?=\\s*(--.*?)?$)",
766 "name": "meta.block.tell.generic.applescript",
767 "patterns": [
768 {
769 "include": "$self"
770 }
771 ]
772 },
773 {
774 "begin": "^\\s*(tell)\\s+(?=.*\\bto\\b)",
775 "captures": {
776 "1": {
777 "name": "keyword.control.tell.applescript"
778 }
779 },
780 "comment": "tell … to statement",
781 "end": "(?<!¬)$",
782 "name": "meta.block.tell.generic.applescript",
783 "patterns": [
784 {
785 "include": "$self"
786 }
787 ]
788 }
789 ]
790 },
791 "built-in": {
792 "patterns": [
793 {
794 "include": "#built-in.constant"
795 },
796 {
797 "include": "#built-in.keyword"
798 },
799 {
800 "include": "#built-in.support"
801 },
802 {
803 "include": "#built-in.punctuation"
804 }
805 ]
806 },
807 "built-in.constant": {
808 "patterns": [
809 {
810 "comment": "yes/no can’t always be used as booleans, e.g. in an if() expression. But they work e.g. for boolean arguments.",
811 "match": "\\b(?i:true|false|yes|no)\\b",
812 "name": "constant.language.boolean.applescript"
813 },
814 {
815 "match": "\\b(?i:null|missing\\s+value)\\b",
816 "name": "constant.language.null.applescript"
817 },
818 {
819 "match": "-?\\b\\d+((\\.(\\d+\\b)?)?(?i:e\\+?\\d*\\b)?|\\b)",
820 "name": "constant.numeric.applescript"
821 },
822 {
823 "match": "\\b(?i:space|tab|return|linefeed|quote)\\b",
824 "name": "constant.other.text.applescript"
825 },
826 {
827 "match": "\\b(?i:all\\s+(caps|lowercase)|bold|condensed|expanded|hidden|italic|outline|plain|shadow|small\\s+caps|strikethrough|(sub|super)script|underline)\\b",
828 "name": "constant.other.styles.applescript"
829 },
830 {
831 "match": "\\b(?i:Jan(uary)?|Feb(ruary)?|Mar(ch)?|Apr(il)?|May|Jun(e)?|Jul(y)?|Aug(ust)?|Sep(tember)?|Oct(ober)?|Nov(ember)?|Dec(ember)?)\\b",
832 "name": "constant.other.time.month.applescript"
833 },
834 {
835 "match": "\\b(?i:Mon(day)?|Tue(sday)?|Wed(nesday)?|Thu(rsday)?|Fri(day)?|Sat(urday)?|Sun(day)?)\\b",
836 "name": "constant.other.time.weekday.applescript"
837 },
838 {
839 "match": "\\b(?i:AppleScript|pi|result|version|current\\s+application|its?|m[ey])\\b",
840 "name": "constant.other.miscellaneous.applescript"
841 },
842 {
843 "match": "\\b(?i:text\\s+item\\s+delimiters|print\\s+(length|depth))\\b",
844 "name": "variable.language.applescript"
845 }
846 ]
847 },
848 "built-in.keyword": {
849 "patterns": [
850 {
851 "match": "(&|\\*|\\+|-|/|÷|\\^)",
852 "name": "keyword.operator.arithmetic.applescript"
853 },
854 {
855 "match": "(=|≠|>|<|≥|>=|≤|<=)",
856 "name": "keyword.operator.comparison.applescript"
857 },
858 {
859 "match": "(?ix)\\b\n\t\t\t\t\t\t(and|or|div|mod|as|not\n\t\t\t\t\t\t|(a\\s+)?(ref(\\s+to)?|reference\\s+to)\n\t\t\t\t\t\t|equal(s|\\s+to)|contains?|comes\\s+(after|before)|(start|begin|end)s?\\s+with\n\t\t\t\t\t\t)\n\t\t\t\t\t\\b",
860 "name": "keyword.operator.word.applescript"
861 },
862 {
863 "comment": "In double quotes so we can use a single quote in the keywords.",
864 "match": "(?ix)\\b\n\t\t\t\t\t\t(is(n't|\\s+not)?(\\s+(equal(\\s+to)?|(less|greater)\\s+than(\\s+or\\s+equal(\\s+to)?)?|in|contained\\s+by))?\n\t\t\t\t\t\t|does(n't|\\s+not)\\s+(equal|come\\s+(before|after)|contain)\n\t\t\t\t\t\t)\n\t\t\t\t\t\\b",
865 "name": "keyword.operator.word.applescript"
866 },
867 {
868 "match": "\\b(?i:some|every|whose|where|that|id|index|\\d+(st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|front|back|middle|named|beginning|end|from|to|thr(u|ough)|before|(front|back|beginning|end)\\s+of|after|behind|in\\s+(front|back|beginning|end)\\s+of)\\b",
869 "name": "keyword.operator.reference.applescript"
870 },
871 {
872 "match": "\\b(?i:continue|return|exit(\\s+repeat)?)\\b",
873 "name": "keyword.control.loop.applescript"
874 },
875 {
876 "match": "\\b(?i:about|above|after|against|and|apart\\s+from|around|as|aside\\s+from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|contain|contains|contains|copy|div|does|eighth|else|end|equal|equals|error|every|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead\\s+of|into|is|it|its|last|local|me|middle|mod|my|ninth|not|of|on|onto|or|out\\s+of|over|prop|property|put|ref|reference|repeat|returning|script|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\\b",
877 "name": "keyword.other.applescript"
878 }
879 ]
880 },
881 "built-in.punctuation": {
882 "patterns": [
883 {
884 "match": "¬",
885 "name": "punctuation.separator.continuation.line.applescript"
886 },
887 {
888 "comment": "the : in property assignments",
889 "match": ":",
890 "name": "punctuation.separator.key-value.property.applescript"
891 },
892 {
893 "comment": "the parentheses in groups",
894 "match": "[()]",
895 "name": "punctuation.section.group.applescript"
896 }
897 ]
898 },
899 "built-in.support": {
900 "patterns": [
901 {
902 "match": "\\b(?i:POSIX\\s+path|frontmost|id|name|running|version|days?|weekdays?|months?|years?|time|date\\s+string|time\\s+string|length|rest|reverse|items?|contents|quoted\\s+form|characters?|paragraphs?|words?)\\b",
903 "name": "support.function.built-in.property.applescript"
904 },
905 {
906 "match": "\\b(?i:activate|log|clipboard\\s+info|set\\s+the\\s+clipboard\\s+to|the\\s+clipboard|info\\s+for|list\\s+(disks|folder)|mount\\s+volume|path\\s+to(\\s+resource)?|close\\s+access|get\\s+eof|open\\s+for\\s+access|read|set\\s+eof|write|open\\s+location|current\\s+date|do\\s+shell\\s+script|get\\s+volume\\s+settings|random\\s+number|round|set\\s+volume|system\\s+(attribute|info)|time\\s+to\\s+GMT|load\\s+script|run\\s+script|scripting\\s+components|store\\s+script|copy|count|get|launch|run|set|ASCII\\s+(character|number)|localized\\s+string|offset|summarize|beep|choose\\s+(application|color|file(\\s+name)?|folder|from\\s+list|remote\\s+application|URL)|delay|display\\s+(alert|dialog)|say)\\b",
907 "name": "support.function.built-in.command.applescript"
908 },
909 {
910 "match": "\\b(?i:get|run)\\b",
911 "name": "support.function.built-in.applescript"
912 },
913 {
914 "match": "\\b(?i:anything|data|text|upper\\s+case|propert(y|ies))\\b",
915 "name": "support.class.built-in.applescript"
916 },
917 {
918 "match": "\\b(?i:alias|class)(es)?\\b",
919 "name": "support.class.built-in.applescript"
920 },
921 {
922 "match": "\\b(?i:app(lication)?|boolean|character|constant|date|event|file(\\s+specification)?|handler|integer|item|keystroke|linked\\s+list|list|machine|number|picture|preposition|POSIX\\s+file|real|record|reference(\\s+form)?|RGB\\s+color|script|sound|text\\s+item|type\\s+class|vector|writing\\s+code(\\s+info)?|zone|((international|styled(\\s+(Clipboard|Unicode))?|Unicode)\\s+)?text|((C|encoded|Pascal)\\s+)?string)s?\\b",
923 "name": "support.class.built-in.applescript"
924 },
925 {
926 "match": "(?ix)\\b\n\t\t\t\t\t\t(\t(cubic\\s+(centi)?|square\\s+(kilo)?|centi|kilo)met(er|re)s\n\t\t\t\t\t\t|\tsquare\\s+(yards|feet|miles)|cubic\\s+(yards|feet|inches)|miles|inches\n\t\t\t\t\t\t|\tlit(re|er)s|gallons|quarts\n\t\t\t\t\t\t|\t(kilo)?grams|ounces|pounds\n\t\t\t\t\t\t|\tdegrees\\s+(Celsius|Fahrenheit|Kelvin)\n\t\t\t\t\t\t)\n\t\t\t\t\t\\b",
927 "name": "support.class.built-in.unit.applescript"
928 },
929 {
930 "match": "\\b(?i:seconds|minutes|hours|days)\\b",
931 "name": "support.class.built-in.time.applescript"
932 }
933 ]
934 },
935 "comments": {
936 "patterns": [
937 {
938 "begin": "^\\s*(#!)",
939 "captures": {
940 "1": {
941 "name": "punctuation.definition.comment.applescript"
942 }
943 },
944 "end": "\\n",
945 "name": "comment.line.number-sign.applescript"
946 },
947 {
948 "begin": "(^[ \\t]+)?(?=#)",
949 "beginCaptures": {
950 "1": {
951 "name": "punctuation.whitespace.comment.leading.applescript"
952 }
953 },
954 "end": "(?!\\G)",
955 "patterns": [
956 {
957 "begin": "#",
958 "beginCaptures": {
959 "0": {
960 "name": "punctuation.definition.comment.applescript"
961 }
962 },
963 "end": "\\n",
964 "name": "comment.line.number-sign.applescript"
965 }
966 ]
967 },
968 {
969 "begin": "(^[ \\t]+)?(?=--)",
970 "beginCaptures": {
971 "1": {
972 "name": "punctuation.whitespace.comment.leading.applescript"
973 }
974 },
975 "end": "(?!\\G)",
976 "patterns": [
977 {
978 "begin": "--",
979 "beginCaptures": {
980 "0": {
981 "name": "punctuation.definition.comment.applescript"
982 }
983 },
984 "end": "\\n",
985 "name": "comment.line.double-dash.applescript"
986 }
987 ]
988 },
989 {
990 "begin": "\\(\\*",
991 "captures": {
992 "0": {
993 "name": "punctuation.definition.comment.applescript"
994 }
995 },
996 "end": "\\*\\)",
997 "name": "comment.block.applescript",
998 "patterns": [
999 {
1000 "include": "#comments.nested"
1001 }
1002 ]
1003 }
1004 ]
1005 },
1006 "comments.nested": {
1007 "patterns": [
1008 {
1009 "begin": "\\(\\*",
1010 "beginCaptures": {
1011 "0": {
1012 "name": "punctuation.definition.comment.begin.applescript"
1013 }
1014 },
1015 "end": "\\*\\)",
1016 "endCaptures": {
1017 "0": {
1018 "name": "punctuation.definition.comment.end.applescript"
1019 }
1020 },
1021 "name": "comment.block.applescript",
1022 "patterns": [
1023 {
1024 "include": "#comments.nested"
1025 }
1026 ]
1027 }
1028 ]
1029 },
1030 "data-structures": {
1031 "patterns": [
1032 {
1033 "begin": "\\{",
1034 "beginCaptures": {
1035 "0": {
1036 "name": "punctuation.definition.array.begin.applescript"
1037 }
1038 },
1039 "comment": "We cannot necessarily distinguish \"records\" from \"arrays\", and so this could be either.",
1040 "end": "\\}",
1041 "endCaptures": {
1042 "0": {
1043 "name": "punctuation.definition.array.end.applescript"
1044 }
1045 },
1046 "name": "meta.array.applescript",
1047 "patterns": [
1048 {
1049 "captures": {
1050 "1": {
1051 "name": "constant.other.key.applescript"
1052 },
1053 "2": {
1054 "name": "meta.identifier.applescript"
1055 },
1056 "3": {
1057 "name": "punctuation.definition.identifier.applescript"
1058 },
1059 "4": {
1060 "name": "punctuation.definition.identifier.applescript"
1061 },
1062 "5": {
1063 "name": "punctuation.separator.key-value.applescript"
1064 }
1065 },
1066 "match": "(\\w+|((\\|)[^|\\n]*(\\|)))\\s*(:)"
1067 },
1068 {
1069 "match": ":",
1070 "name": "punctuation.separator.key-value.applescript"
1071 },
1072 {
1073 "match": ",",
1074 "name": "punctuation.separator.array.applescript"
1075 },
1076 {
1077 "include": "#inline"
1078 }
1079 ]
1080 },
1081 {
1082 "begin": "(?:(?<=application )|(?<=app ))(\")",
1083 "captures": {
1084 "1": {
1085 "name": "punctuation.definition.string.applescript"
1086 }
1087 },
1088 "end": "(\")",
1089 "name": "string.quoted.double.application-name.applescript",
1090 "patterns": [
1091 {
1092 "match": "\\\\.",
1093 "name": "constant.character.escape.applescript"
1094 }
1095 ]
1096 },
1097 {
1098 "begin": "(\")",
1099 "captures": {
1100 "1": {
1101 "name": "punctuation.definition.string.applescript"
1102 }
1103 },
1104 "end": "(\")",
1105 "name": "string.quoted.double.applescript",
1106 "patterns": [
1107 {
1108 "match": "\\\\.",
1109 "name": "constant.character.escape.applescript"
1110 }
1111 ]
1112 },
1113 {
1114 "captures": {
1115 "1": {
1116 "name": "punctuation.definition.identifier.applescript"
1117 },
1118 "2": {
1119 "name": "punctuation.definition.identifier.applescript"
1120 }
1121 },
1122 "match": "(\\|)[^|\\n]*(\\|)",
1123 "name": "meta.identifier.applescript"
1124 },
1125 {
1126 "captures": {
1127 "1": {
1128 "name": "punctuation.definition.data.applescript"
1129 },
1130 "2": {
1131 "name": "support.class.built-in.applescript"
1132 },
1133 "3": {
1134 "name": "storage.type.utxt.applescript"
1135 },
1136 "4": {
1137 "name": "string.unquoted.data.applescript"
1138 },
1139 "5": {
1140 "name": "punctuation.definition.data.applescript"
1141 },
1142 "6": {
1143 "name": "keyword.operator.applescript"
1144 },
1145 "7": {
1146 "name": "support.class.built-in.applescript"
1147 }
1148 },
1149 "match": "(«)(data) (utxt|utf8)([[:xdigit:]]*)(»)(?:\\s+(as)\\s+(?i:Unicode\\s+text))?",
1150 "name": "constant.other.data.utxt.applescript"
1151 },
1152 {
1153 "begin": "(«)(\\w+)\\b(?=\\s)",
1154 "beginCaptures": {
1155 "1": {
1156 "name": "punctuation.definition.data.applescript"
1157 },
1158 "2": {
1159 "name": "support.class.built-in.applescript"
1160 }
1161 },
1162 "end": "(»)",
1163 "endCaptures": {
1164 "1": {
1165 "name": "punctuation.definition.data.applescript"
1166 }
1167 },
1168 "name": "constant.other.data.raw.applescript"
1169 },
1170 {
1171 "captures": {
1172 "1": {
1173 "name": "punctuation.definition.data.applescript"
1174 },
1175 "2": {
1176 "name": "punctuation.definition.data.applescript"
1177 }
1178 },
1179 "match": "(«)[^»]*(»)",
1180 "name": "invalid.illegal.data.applescript"
1181 }
1182 ]
1183 },
1184 "finder": {
1185 "patterns": [
1186 {
1187 "match": "\\b(item|container|(computer|disk|trash)-object|disk|folder|((alias|application|document|internet location) )?file|clipping|package)s?\\b",
1188 "name": "support.class.finder.items.applescript"
1189 },
1190 {
1191 "match": "\\b((Finder|desktop|information|preferences|clipping) )windows?\\b",
1192 "name": "support.class.finder.window-classes.applescript"
1193 },
1194 {
1195 "match": "\\b(preferences|(icon|column|list) view options|(label|column|alias list)s?)\\b",
1196 "name": "support.class.finder.type-definitions.applescript"
1197 },
1198 {
1199 "match": "\\b(copy|find|sort|clean up|eject|empty( trash)|erase|reveal|update)\\b",
1200 "name": "support.function.finder.items.applescript"
1201 },
1202 {
1203 "match": "\\b(insertion location|product version|startup disk|desktop|trash|home|computer container|finder preferences)\\b",
1204 "name": "support.constant.finder.applescript"
1205 },
1206 {
1207 "match": "\\b(visible)\\b",
1208 "name": "support.variable.finder.applescript"
1209 }
1210 ]
1211 },
1212 "inline": {
1213 "patterns": [
1214 {
1215 "include": "#comments"
1216 },
1217 {
1218 "include": "#data-structures"
1219 },
1220 {
1221 "include": "#built-in"
1222 },
1223 {
1224 "include": "#standardadditions"
1225 }
1226 ]
1227 },
1228 "itunes": {
1229 "patterns": [
1230 {
1231 "match": "\\b(artwork|application|encoder|EQ preset|item|source|visual|(EQ |browser )?window|((audio CD|device|shared|URL|file) )?track|playlist window|((audio CD|device|radio tuner|library|folder|user) )?playlist)s?\\b",
1232 "name": "support.class.itunes.applescript"
1233 },
1234 {
1235 "match": "\\b(add|back track|convert|fast forward|(next|previous) track|pause|play(pause)?|refresh|resume|rewind|search|stop|update|eject|subscribe|update(Podcast|AllPodcasts)|download)\\b",
1236 "name": "support.function.itunes.applescript"
1237 },
1238 {
1239 "match": "\\b(current (playlist|stream (title|URL)|track)|player state)\\b",
1240 "name": "support.constant.itunes.applescript"
1241 },
1242 {
1243 "match": "\\b(current (encoder|EQ preset|visual)|EQ enabled|fixed indexing|full screen|mute|player position|sound volume|visuals enabled|visual size)\\b",
1244 "name": "support.variable.itunes.applescript"
1245 }
1246 ]
1247 },
1248 "standard-suite": {
1249 "patterns": [
1250 {
1251 "match": "\\b(colors?|documents?|items?|windows?)\\b",
1252 "name": "support.class.standard-suite.applescript"
1253 },
1254 {
1255 "match": "\\b(close|count|delete|duplicate|exists|make|move|open|print|quit|save|activate|select|data size)\\b",
1256 "name": "support.function.standard-suite.applescript"
1257 },
1258 {
1259 "match": "\\b(name|frontmost|version)\\b",
1260 "name": "support.constant.standard-suite.applescript"
1261 },
1262 {
1263 "match": "\\b(selection)\\b",
1264 "name": "support.variable.standard-suite.applescript"
1265 },
1266 {
1267 "match": "\\b(attachments?|attribute runs?|characters?|paragraphs?|texts?|words?)\\b",
1268 "name": "support.class.text-suite.applescript"
1269 }
1270 ]
1271 },
1272 "standardadditions": {
1273 "patterns": [
1274 {
1275 "match": "\\b((alert|dialog) reply)\\b",
1276 "name": "support.class.standardadditions.user-interaction.applescript"
1277 },
1278 {
1279 "match": "\\b(file information)\\b",
1280 "name": "support.class.standardadditions.file.applescript"
1281 },
1282 {
1283 "match": "\\b(POSIX files?|system information|volume settings)\\b",
1284 "name": "support.class.standardadditions.miscellaneous.applescript"
1285 },
1286 {
1287 "match": "\\b(URLs?|internet address(es)?|web pages?|FTP items?)\\b",
1288 "name": "support.class.standardadditions.internet.applescript"
1289 },
1290 {
1291 "match": "\\b(info for|list (disks|folder)|mount volume|path to( resource)?)\\b",
1292 "name": "support.function.standardadditions.file.applescript"
1293 },
1294 {
1295 "match": "\\b(beep|choose (application|color|file( name)?|folder|from list|remote application|URL)|delay|display (alert|dialog)|say)\\b",
1296 "name": "support.function.standardadditions.user-interaction.applescript"
1297 },
1298 {
1299 "match": "\\b(ASCII (character|number)|localized string|offset|summarize)\\b",
1300 "name": "support.function.standardadditions.string.applescript"
1301 },
1302 {
1303 "match": "\\b(set the clipboard to|the clipboard|clipboard info)\\b",
1304 "name": "support.function.standardadditions.clipboard.applescript"
1305 },
1306 {
1307 "match": "\\b(open for access|close access|read|write|get eof|set eof)\\b",
1308 "name": "support.function.standardadditions.file-i-o.applescript"
1309 },
1310 {
1311 "match": "\\b((load|store|run) script|scripting components)\\b",
1312 "name": "support.function.standardadditions.scripting.applescript"
1313 },
1314 {
1315 "match": "\\b(current date|do shell script|get volume settings|random number|round|set volume|system attribute|system info|time to GMT)\\b",
1316 "name": "support.function.standardadditions.miscellaneous.applescript"
1317 },
1318 {
1319 "match": "\\b(opening folder|(closing|moving) folder window for|adding folder items to|removing folder items from)\\b",
1320 "name": "support.function.standardadditions.folder-actions.applescript"
1321 },
1322 {
1323 "match": "\\b(open location|handle CGI request)\\b",
1324 "name": "support.function.standardadditions.internet.applescript"
1325 }
1326 ]
1327 },
1328 "system-events": {
1329 "patterns": [
1330 {
1331 "match": "\\b(audio (data|file))\\b",
1332 "name": "support.class.system-events.audio-file.applescript"
1333 },
1334 {
1335 "match": "\\b(alias(es)?|(Classic|local|network|system|user) domain objects?|disk( item)?s?|domains?|file( package)?s?|folders?|items?)\\b",
1336 "name": "support.class.system-events.disk-folder-file.applescript"
1337 },
1338 {
1339 "match": "\\b(delete|open|move)\\b",
1340 "name": "support.function.system-events.disk-folder-file.applescript"
1341 },
1342 {
1343 "match": "\\b(folder actions?|scripts?)\\b",
1344 "name": "support.class.system-events.folder-actions.applescript"
1345 },
1346 {
1347 "match": "\\b(attach action to|attached scripts|edit action of|remove action from)\\b",
1348 "name": "support.function.system-events.folder-actions.applescript"
1349 },
1350 {
1351 "match": "\\b(movie data|movie file)\\b",
1352 "name": "support.class.system-events.movie-file.applescript"
1353 },
1354 {
1355 "match": "\\b(log out|restart|shut down|sleep)\\b",
1356 "name": "support.function.system-events.power.applescript"
1357 },
1358 {
1359 "match": "\\b(((application |desk accessory )?process|(check|combo )?box)(es)?|(action|attribute|browser|(busy|progress|relevance) indicator|color well|column|drawer|group|grow area|image|incrementor|list|menu( bar)?( item)?|(menu |pop up |radio )?button|outline|(radio|tab|splitter) group|row|scroll (area|bar)|sheet|slider|splitter|static text|table|text (area|field)|tool bar|UI element|window)s?)\\b",
1360 "name": "support.class.system-events.processes.applescript"
1361 },
1362 {
1363 "match": "\\b(click|key code|keystroke|perform|select)\\b",
1364 "name": "support.function.system-events.processes.applescript"
1365 },
1366 {
1367 "match": "\\b(property list (file|item))\\b",
1368 "name": "support.class.system-events.property-list.applescript"
1369 },
1370 {
1371 "match": "\\b(annotation|QuickTime (data|file)|track)s?\\b",
1372 "name": "support.class.system-events.quicktime-file.applescript"
1373 },
1374 {
1375 "match": "\\b((abort|begin|end) transaction)\\b",
1376 "name": "support.function.system-events.system-events.applescript"
1377 },
1378 {
1379 "match": "\\b(XML (attribute|data|element|file)s?)\\b",
1380 "name": "support.class.system-events.xml.applescript"
1381 },
1382 {
1383 "match": "\\b(print settings|users?|login items?)\\b",
1384 "name": "support.class.sytem-events.other.applescript"
1385 }
1386 ]
1387 },
1388 "textmate": {
1389 "patterns": [
1390 {
1391 "match": "\\b(print settings)\\b",
1392 "name": "support.class.textmate.applescript"
1393 },
1394 {
1395 "match": "\\b(get url|insert|reload bundles)\\b",
1396 "name": "support.function.textmate.applescript"
1397 }
1398 ]
1399 }
1400 },
1401 "scopeName": "source.applescript",
1402 "uuid": "777CF925-14B9-428E-B07B-17FAAB8FA27E"
1403 }
1404