forked from pilotmoon/PopClip-Extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExtensionSchema.json
908 lines (907 loc) · 44.7 KB
/
ExtensionSchema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ActionFunction": {
"description": "A calable object, with additional properties to define its title, icon and other properties.",
"properties": {
"after": {
"description": "An optional step to peform after the main action.",
"enum": [
"copy",
"copy-result",
"cut",
"paste",
"paste-plain",
"paste-result",
"popclip-appear",
"preview-result",
"show-result",
"show-status"
],
"type": "string"
},
"app": {
"$ref": "#/definitions/AssociatedApp",
"description": "Declares the application or website associated with this action, if any."
},
"applescript": {
"type": "string"
},
"applescriptCall": {
"properties": {
"file": {
"type": "string"
},
"handler": {
"type": "string"
},
"parameters": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"applescriptFile": {
"type": "string"
},
"before": {
"description": "An optional step to peform before the main action.",
"enum": [
"copy",
"cut",
"paste",
"paste-plain",
"popclip-appear",
"show-status"
],
"type": "string"
},
"captureHtml": {
"description": "Whether PopClip will capture HTML and Markdown content for the selection. Default is no.\n\n#### Notes\nThe HTML can be accessed in the [[Selection.html]] property, and the Markdown\ncan be accessed in the [[Selection.markdown]] property.\n\nIf the selection is not HTML-backed, PopClip will generate HTML from any available RTF or plain text\ncontent.",
"type": "boolean"
},
"captureRtf": {
"description": "Whether PopClip will capture RTF (Rich Text Format) content for the selection. Default is no.\n\n#### Notes\nCaptured RTF can be accessed in the [[Selection.items]] property under the `public.rtf` key.",
"type": "boolean"
},
"excludedApps": {
"description": "Array of bundle identifiers for which the extension should not appear. The action will not\nappear if PopClip is used in any of the specified apps.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"type": "string"
},
"type": "array"
},
"icon": {
"description": "A string to define the action's icon. See [[IconString]].\n\nIf no icon is defined here, the extension's {@link Extension.icon | icon} will be used, if any.\nSetting to `null` explicitly sets the action to have no icon.",
"type": [
"null",
"string"
]
},
"identifier": {
"description": "A unique identifying string.\n\n#### Notes\n\nAn identifier for an action can be any string of your choosing.\n\nAn identifier for the extension itself, if provided, should ideally be globally unique.\n\nI suggest using a reverse DNS-style identifier. For example `com.example.myextension`.\n\nIf you don't have your own domain name, you can use anything you like — it doesn't matter, as long as it is unique.\n\nDo not use the `com.pilotmoon.` prefix for your own extension.",
"type": "string"
},
"javascript": {
"type": "string"
},
"javascriptFile": {
"type": "string"
},
"keyCombo": {
"type": [
"string",
"number"
]
},
"keyCombos": {
"items": {
"type": [
"string",
"number"
]
},
"type": "array"
},
"preserveImageColor": {
"description": "Whether the action's icon should be displayed in its original color rather than monochrome.",
"type": "boolean"
},
"regex": {
"anyOf": [
{
"$ref": "#/definitions/RegExp"
},
{
"type": "string"
}
],
"description": "A regular expression to decide whether this action appears in the popup.\n\n* If no regex is specified here, the action takes the value of [[Extension.regex]].\n* If no regex is specified there either, the action will match any input.\n\n#### Notes\n\nYou may express the value either as a\n[JavaScript regular expression literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)\n(or otherwise constructed `RegExp` object), or as a string.\n\n* If you supply a `RegExp` it will be evaluated in the JavaScript engine.\n* If you supply a string it will be evaluated by macOS natively using the `NSRegularExpression` API (same as for 'classic' PopClip extensions).\n\nIf the regex matches the selected text, the action will be shown in the popup and\nthe first occurrence of the matched text is accessible later via {@link Input.matchedText | matchedText}.\n\nIf there is no match, the action is excluded from the popup.\n\nThe regex's `lastIndex` is reset before and after each invocation, so the `g` (global) and `y` (sticky) flags have no effect.\n\nThis property has no effect on dynamically generated actions.\n\n#### Example\n```js\nregex = /abc/i // Example regex 'abc' with 'i' (case insensitive) flag\n // Matches abc, ABC, Abc, etc.\n```"
},
"requiredApps": {
"description": "Array of bundle identifiers for which the extension should appear. The action will only\nappear if PopCLip is used in one of the specified apps.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"type": "string"
},
"type": "array"
},
"requirements": {
"description": "An array of conditions which must be met for this action to appear — see [[Requirement]].\n\n* If no array is specified here, the action takes the value of [[Extension.requirements]].\n* If no array is specified there either, the action takes the default value `[\"text\"]`.\n\n#### Notes\n\nWhen multiple conditions are specified, all of them must be satisfied.\n\nAn empty array (`[]`) indicates no requirements at all, meaning the action will always appear.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"enum": [
"!copy",
"!cut",
"!email",
"!emails",
"!formatting",
"!paste",
"!path",
"!text",
"!url",
"!urls",
"copy",
"cut",
"email",
"emails",
"formatting",
"paste",
"path",
"text",
"url",
"urls"
],
"type": "string"
}
]
},
"type": "array"
},
"restorePasteboard": {
"description": "Whether the pasteboard should be restored to its original state after `paste-result`.",
"type": "boolean"
},
"scriptInterpreter": {
"type": "string"
},
"serviceName": {
"type": "string"
},
"shellScriptFile": {
"type": "string"
},
"shortcutName": {
"type": "string"
},
"stayVisible": {
"description": "Whether PopClip's popup should stay on screen after clicking this action's button. Default is no.\n\n#### Notes\nAn example of this in use is the Formatting extension.",
"type": "boolean"
},
"title": {
"anyOf": [
{
"$ref": "#/definitions/StringTable"
},
{
"type": "string"
}
],
"description": "The action's title. The title is displayed in the action button if there is no icon.\nFor extensions with icons, the title is displayed in the tooltip.\n\nIf no title is defined here, the extension's [`[name]] will be used, if any."
},
"url": {
"type": "string"
}
},
"type": "object"
},
"ActionObject": {
"description": "An alternative way to define as an action, as a non-callable object with a `code` member.\nIf code is omitted, displays as disabled title/icon only.",
"properties": {
"after": {
"description": "An optional step to peform after the main action.",
"enum": [
"copy",
"copy-result",
"cut",
"paste",
"paste-plain",
"paste-result",
"popclip-appear",
"preview-result",
"show-result",
"show-status"
],
"type": "string"
},
"app": {
"$ref": "#/definitions/AssociatedApp",
"description": "Declares the application or website associated with this action, if any."
},
"applescript": {
"type": "string"
},
"applescriptCall": {
"properties": {
"file": {
"type": "string"
},
"handler": {
"type": "string"
},
"parameters": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"applescriptFile": {
"type": "string"
},
"before": {
"description": "An optional step to peform before the main action.",
"enum": [
"copy",
"cut",
"paste",
"paste-plain",
"popclip-appear",
"show-status"
],
"type": "string"
},
"captureHtml": {
"description": "Whether PopClip will capture HTML and Markdown content for the selection. Default is no.\n\n#### Notes\nThe HTML can be accessed in the [[Selection.html]] property, and the Markdown\ncan be accessed in the [[Selection.markdown]] property.\n\nIf the selection is not HTML-backed, PopClip will generate HTML from any available RTF or plain text\ncontent.",
"type": "boolean"
},
"captureRtf": {
"description": "Whether PopClip will capture RTF (Rich Text Format) content for the selection. Default is no.\n\n#### Notes\nCaptured RTF can be accessed in the [[Selection.items]] property under the `public.rtf` key.",
"type": "boolean"
},
"code": {
"description": "Same function signature as [[ActionFunction]]",
"type": "object"
},
"excludedApps": {
"description": "Array of bundle identifiers for which the extension should not appear. The action will not\nappear if PopClip is used in any of the specified apps.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"type": "string"
},
"type": "array"
},
"icon": {
"description": "A string to define the action's icon. See [[IconString]].\n\nIf no icon is defined here, the extension's {@link Extension.icon | icon} will be used, if any.\nSetting to `null` explicitly sets the action to have no icon.",
"type": [
"null",
"string"
]
},
"identifier": {
"description": "A unique identifying string.\n\n#### Notes\n\nAn identifier for an action can be any string of your choosing.\n\nAn identifier for the extension itself, if provided, should ideally be globally unique.\n\nI suggest using a reverse DNS-style identifier. For example `com.example.myextension`.\n\nIf you don't have your own domain name, you can use anything you like — it doesn't matter, as long as it is unique.\n\nDo not use the `com.pilotmoon.` prefix for your own extension.",
"type": "string"
},
"javascript": {
"type": "string"
},
"javascriptFile": {
"type": "string"
},
"keyCombo": {
"type": [
"string",
"number"
]
},
"keyCombos": {
"items": {
"type": [
"string",
"number"
]
},
"type": "array"
},
"preserveImageColor": {
"description": "Whether the action's icon should be displayed in its original color rather than monochrome.",
"type": "boolean"
},
"regex": {
"anyOf": [
{
"$ref": "#/definitions/RegExp"
},
{
"type": "string"
}
],
"description": "A regular expression to decide whether this action appears in the popup.\n\n* If no regex is specified here, the action takes the value of [[Extension.regex]].\n* If no regex is specified there either, the action will match any input.\n\n#### Notes\n\nYou may express the value either as a\n[JavaScript regular expression literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)\n(or otherwise constructed `RegExp` object), or as a string.\n\n* If you supply a `RegExp` it will be evaluated in the JavaScript engine.\n* If you supply a string it will be evaluated by macOS natively using the `NSRegularExpression` API (same as for 'classic' PopClip extensions).\n\nIf the regex matches the selected text, the action will be shown in the popup and\nthe first occurrence of the matched text is accessible later via {@link Input.matchedText | matchedText}.\n\nIf there is no match, the action is excluded from the popup.\n\nThe regex's `lastIndex` is reset before and after each invocation, so the `g` (global) and `y` (sticky) flags have no effect.\n\nThis property has no effect on dynamically generated actions.\n\n#### Example\n```js\nregex = /abc/i // Example regex 'abc' with 'i' (case insensitive) flag\n // Matches abc, ABC, Abc, etc.\n```"
},
"requiredApps": {
"description": "Array of bundle identifiers for which the extension should appear. The action will only\nappear if PopCLip is used in one of the specified apps.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"type": "string"
},
"type": "array"
},
"requirements": {
"description": "An array of conditions which must be met for this action to appear — see [[Requirement]].\n\n* If no array is specified here, the action takes the value of [[Extension.requirements]].\n* If no array is specified there either, the action takes the default value `[\"text\"]`.\n\n#### Notes\n\nWhen multiple conditions are specified, all of them must be satisfied.\n\nAn empty array (`[]`) indicates no requirements at all, meaning the action will always appear.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"enum": [
"!copy",
"!cut",
"!email",
"!emails",
"!formatting",
"!paste",
"!path",
"!text",
"!url",
"!urls",
"copy",
"cut",
"email",
"emails",
"formatting",
"paste",
"path",
"text",
"url",
"urls"
],
"type": "string"
}
]
},
"type": "array"
},
"restorePasteboard": {
"description": "Whether the pasteboard should be restored to its original state after `paste-result`.",
"type": "boolean"
},
"scriptInterpreter": {
"type": "string"
},
"serviceName": {
"type": "string"
},
"shellScriptFile": {
"type": "string"
},
"shortcutName": {
"type": "string"
},
"stayVisible": {
"description": "Whether PopClip's popup should stay on screen after clicking this action's button. Default is no.\n\n#### Notes\nAn example of this in use is the Formatting extension.",
"type": "boolean"
},
"title": {
"anyOf": [
{
"$ref": "#/definitions/StringTable"
},
{
"type": "string"
}
],
"description": "The action's title. The title is displayed in the action button if there is no icon.\nFor extensions with icons, the title is displayed in the tooltip.\n\nIf no title is defined here, the extension's [`[name]] will be used, if any."
},
"url": {
"type": "string"
}
},
"type": "object"
},
"AssociatedApp": {
"description": "Declares information about an app or website that this extension interacts with.",
"properties": {
"bundleIdentifiers": {
"description": "List of possible bundle identifiers of this app.\n\nPopCLip uses this list when checking for the presence of the app. Include here all application variants\nthat work with this extension. In the simplest case there may\nbe just one bundle ID, but an app may have alternative bundle IDs such as for free/pro variants,\nan App Store version, a stand-alone version, a Setapp version, and so on.",
"items": {
"type": "string"
},
"type": "array"
},
"checkInstalled": {
"description": "Indicates whether PopClip should check for the presence of the app on the computer. If not found,\nPopCLip will display a message prompting the user to install the app. Default is no. Not applicable for websites.",
"type": "boolean"
},
"link": {
"description": "Web page where user can obtain the app, e.g. \"https://www.literatureandlatte.com/scrivener\".\n\nPopClip will link to this page if the \"missing app\" dialog is shown. The link is also used\nthis in the online extension listing.",
"type": "string"
},
"name": {
"description": "Name of the app. Fo example \"Scrivener\"",
"type": "string"
}
},
"type": "object"
},
"Option": {
"description": "Defines a single extension option.",
"properties": {
"defaultValue": {
"description": "The default value of the option. If ommitted, `string` options default to the empty string,\n`boolean` options default to true, and `multiple` options default to the top item in the list.\nA `password` field may not have a default value.",
"type": [
"string",
"boolean"
]
},
"description": {
"anyOf": [
{
"$ref": "#/definitions/StringTable"
},
{
"type": "string"
}
],
"description": "An optional longer explanantion of this option, to be shown in the UI."
},
"icon": {
"description": "An icon for this option. It is only displayed for boolean options, next to the check box. See [[IconString]].",
"type": "string"
},
"identifier": {
"description": "An identifying string for this option.",
"type": "string"
},
"label": {
"anyOf": [
{
"$ref": "#/definitions/StringTable"
},
{
"type": "string"
}
],
"description": "A short label for this option."
},
"type": {
"description": "The kind of option, one of:\n * `string`: a text box for free text entry,\n * `boolean`: a check box,\n * `multiple`: multiple-choice drop-down with predefined options,\n * `password`: a password entry field (passwords are stored in user's keychain instead of preferences),\n * `heading`: adds a heading in the user interface, but does not actually define an option",
"enum": [
"boolean",
"heading",
"multiple",
"password",
"string"
],
"type": "string"
},
"valueLabels": {
"description": "Display names corresponding to the entries in the [[values]] array. These are shown in the option UI.\nIf ommitted, the raw value strings are shown instead.",
"items": {
"anyOf": [
{
"$ref": "#/definitions/StringTable"
},
{
"type": "string"
}
],
"description": "A type to represent a localizable string.\n\n#### Notes\n\nThe value may be either a string or an object.\nIf you supply a string, that string is used.\nIf you supply a [[StringTable]] object, PopClip will\ndisplay the string for the user's preferred language if possible, with fallback to the `en` string.\n\n#### Example\n```js\noption.label = \"Color\" // just use this string\noption.label = { en: \"Color\", \"en-GB\": \"Colour\", fr: \"Couleur\", \"zh-Hans\": \"颜色\" }"
},
"type": "array"
},
"values": {
"description": "The possible values for a `multiple` option.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"RegExp": {
"properties": {
"dotAll": {
"type": "boolean"
},
"flags": {
"type": "string"
},
"global": {
"type": "boolean"
},
"ignoreCase": {
"type": "boolean"
},
"lastIndex": {
"type": "number"
},
"multiline": {
"type": "boolean"
},
"source": {
"type": "string"
},
"sticky": {
"type": "boolean"
},
"unicode": {
"type": "boolean"
}
},
"type": "object"
},
"StringTable": {
"additionalProperties": {
"type": "string"
},
"description": "An object mapping language codes to strings. See [[LocalizableString]].\n\n#### Notes\n\nAn `en` string is required, as the default fallback, and it should usually\ncontain a string in US English. _(That's the macOS default,\nas a Brit this of course pains me! -Nick)_\n\nThe predefined languages in this interface definition are the ones that\nPopClip currently ships with translations for.\nBut you can include other languages too.\nFor example you can include `en-GB` or `en-CA` string to have different\nregional spellings.",
"properties": {
"da": {
"description": "Danish language string.",
"type": "string"
},
"de": {
"description": "German language string.",
"type": "string"
},
"en": {
"description": "English (US) language string.",
"type": "string"
},
"es": {
"description": "Spanish language string.",
"type": "string"
},
"fr": {
"description": "French language string.",
"type": "string"
},
"it": {
"description": "Italian language string.",
"type": "string"
},
"ja": {
"description": "Japanese language string.",
"type": "string"
},
"ko": {
"description": "Korean language string.",
"type": "string"
},
"nl": {
"description": "Dutch language string.",
"type": "string"
},
"pt-BR": {
"description": "Brazilian Portuguese language string.",
"type": "string"
},
"ru": {
"description": "Russian language string.",
"type": "string"
},
"vi": {
"description": "Vietnamese language string.",
"type": "string"
},
"zh-Hans": {
"description": "Simplified Chinese language string.",
"type": "string"
},
"zh-Hant": {
"description": "Traditional Chinese language string.",
"type": "string"
}
},
"type": "object"
}
},
"description": "The Extension object defines the PopClip extension.\n\nYou create this in Config.js and export it with `define()`.\n\nAny properties omitted from the extension object in Config.js (apart from [[action]] and [[actions]])\nfall back to the equivalent value in the Config.json file, if it is present.\n\n\n#### Examples\n\n*Simple extension* — The following Config.js defines a complete extension:\n\n* Config.js\n```js\n define({\n identifier: \"com.example.my-extension\",\n name: \"My Extension\",\n action: function(selection) {\n popclip.showText(\"Your text is: \" + selection.text)\n }\n })\n```\n\n*Example with Config.json* — The previous example is equivalent to:\n\n* Config.json:\n```json\n{\n \"identifier\": \"com.example.my-extension\",\n \"name\": \"My Extension\",\n}\n```\n\n* Config.js:\n```js\n define({\n action: function(selection) {\n popclip.showText(\"Your text is: \" + selection.text)\n }\n })\n```",
"properties": {
"action": {
"anyOf": [
{
"$ref": "#/definitions/ActionFunction"
},
{
"$ref": "#/definitions/ActionObject"
}
],
"description": "Simplified property to define a single action."
},
"actions": {
"anyOf": [
{
"description": "A population function dynamically generates the actions for the extension. See [[Extension.actions]].",
"type": "object"
},
{
"items": {
"anyOf": [
{
"$ref": "#/definitions/ActionFunction"
},
{
"$ref": "#/definitions/ActionObject"
}
],
"description": "An action can be defined using either the callable object or non-callable object form."
},
"type": "array"
}
],
"description": "Define the actions to go in PopClip's popup. This can be an array or a function.\n\n* If it's an array, the supplied actions are used in the popup, subject to meeting the\nrequirements and regex conditions.\n\n* If it's a function, it is called by PopClip to dynamically populate the popup with actions from this extension.\nSetting requirements and regex keys has no effect on dynamic actions — the function itself is responsible for deciding what actions to show."
},
"after": {
"description": "An optional step to peform after the main action.",
"enum": [
"copy",
"copy-result",
"cut",
"paste",
"paste-plain",
"paste-result",
"popclip-appear",
"preview-result",
"show-result",
"show-status"
],
"type": "string"
},
"app": {
"$ref": "#/definitions/AssociatedApp",
"description": "Declares the application or website associated with this action, if any."
},
"applescript": {
"type": "string"
},
"applescriptCall": {
"properties": {
"file": {
"type": "string"
},
"handler": {
"type": "string"
},
"parameters": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"applescriptFile": {
"type": "string"
},
"auth": {
"description": "Function signature of the [[Extension.auth]] method.",
"type": "object"
},
"before": {
"description": "An optional step to peform before the main action.",
"enum": [
"copy",
"cut",
"paste",
"paste-plain",
"popclip-appear",
"show-status"
],
"type": "string"
},
"captureHtml": {
"description": "Whether PopClip will capture HTML and Markdown content for the selection. Default is no.\n\n#### Notes\nThe HTML can be accessed in the [[Selection.html]] property, and the Markdown\ncan be accessed in the [[Selection.markdown]] property.\n\nIf the selection is not HTML-backed, PopClip will generate HTML from any available RTF or plain text\ncontent.",
"type": "boolean"
},
"captureRtf": {
"description": "Whether PopClip will capture RTF (Rich Text Format) content for the selection. Default is no.\n\n#### Notes\nCaptured RTF can be accessed in the [[Selection.items]] property under the `public.rtf` key.",
"type": "boolean"
},
"entitlements": {
"items": {
"enum": [
"dynamic",
"network"
],
"type": "string"
},
"type": "array"
},
"excludedApps": {
"description": "Array of bundle identifiers for which the extension should not appear. The action will not\nappear if PopClip is used in any of the specified apps.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"type": "string"
},
"type": "array"
},
"icon": {
"description": "A string to define the action's icon. See [[IconString]].\n\nIf no icon is defined here, the extension's {@link Extension.icon | icon} will be used, if any.\nSetting to `null` explicitly sets the action to have no icon.",
"type": [
"null",
"string"
]
},
"identifier": {
"description": "A unique identifying string.\n\n#### Notes\n\nAn identifier for an action can be any string of your choosing.\n\nAn identifier for the extension itself, if provided, should ideally be globally unique.\n\nI suggest using a reverse DNS-style identifier. For example `com.example.myextension`.\n\nIf you don't have your own domain name, you can use anything you like — it doesn't matter, as long as it is unique.\n\nDo not use the `com.pilotmoon.` prefix for your own extension.",
"type": "string"
},
"javascript": {
"type": "string"
},
"javascriptFile": {
"type": "string"
},
"keyCombo": {
"type": [
"string",
"number"
]
},
"keyCombos": {
"items": {
"type": [
"string",
"number"
]
},
"type": "array"
},
"macosVersion": {
"type": "string"
},
"module": {
"type": "string"
},
"name": {
"anyOf": [
{
"$ref": "#/definitions/StringTable"
},
{
"type": "string"
}
],
"description": "The display name of this extension.\n\nIf omitted, the name is taken from the Config.json file, or else auto-generated from the package name."
},
"options": {
"description": "Defines the user-configurable options for this extension.",
"items": {
"$ref": "#/definitions/Option"
},
"type": "array"
},
"popclipVersion": {
"type": "number"
},
"preserveImageColor": {
"description": "Whether the action's icon should be displayed in its original color rather than monochrome.",
"type": "boolean"
},
"regex": {
"anyOf": [
{
"$ref": "#/definitions/RegExp"
},
{
"type": "string"
}
],
"description": "A regular expression to decide whether this action appears in the popup.\n\n* If no regex is specified here, the action takes the value of [[Extension.regex]].\n* If no regex is specified there either, the action will match any input.\n\n#### Notes\n\nYou may express the value either as a\n[JavaScript regular expression literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)\n(or otherwise constructed `RegExp` object), or as a string.\n\n* If you supply a `RegExp` it will be evaluated in the JavaScript engine.\n* If you supply a string it will be evaluated by macOS natively using the `NSRegularExpression` API (same as for 'classic' PopClip extensions).\n\nIf the regex matches the selected text, the action will be shown in the popup and\nthe first occurrence of the matched text is accessible later via {@link Input.matchedText | matchedText}.\n\nIf there is no match, the action is excluded from the popup.\n\nThe regex's `lastIndex` is reset before and after each invocation, so the `g` (global) and `y` (sticky) flags have no effect.\n\nThis property has no effect on dynamically generated actions.\n\n#### Example\n```js\nregex = /abc/i // Example regex 'abc' with 'i' (case insensitive) flag\n // Matches abc, ABC, Abc, etc.\n```"
},
"requiredApps": {
"description": "Array of bundle identifiers for which the extension should appear. The action will only\nappear if PopCLip is used in one of the specified apps.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"type": "string"
},
"type": "array"
},
"requirements": {
"description": "An array of conditions which must be met for this action to appear — see [[Requirement]].\n\n* If no array is specified here, the action takes the value of [[Extension.requirements]].\n* If no array is specified there either, the action takes the default value `[\"text\"]`.\n\n#### Notes\n\nWhen multiple conditions are specified, all of them must be satisfied.\n\nAn empty array (`[]`) indicates no requirements at all, meaning the action will always appear.\n\nThis property has no effect on dynamically generated actions.",
"items": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"enum": [
"!copy",
"!cut",
"!email",
"!emails",
"!formatting",
"!paste",
"!path",
"!text",
"!url",
"!urls",
"copy",
"cut",
"email",
"emails",
"formatting",
"paste",
"path",
"text",
"url",
"urls"
],
"type": "string"
}
]
},
"type": "array"
},
"restorePasteboard": {
"description": "Whether the pasteboard should be restored to its original state after `paste-result`.",
"type": "boolean"
},
"scriptInterpreter": {
"type": "string"
},
"serviceName": {
"type": "string"
},
"shellScriptFile": {
"type": "string"
},
"shortcutName": {
"type": "string"
},
"stayVisible": {
"description": "Whether PopClip's popup should stay on screen after clicking this action's button. Default is no.\n\n#### Notes\nAn example of this in use is the Formatting extension.",
"type": "boolean"
},
"title": {
"anyOf": [
{
"$ref": "#/definitions/StringTable"
},
{
"type": "string"
}
],
"description": "The action's title. The title is displayed in the action button if there is no icon.\nFor extensions with icons, the title is displayed in the tooltip.\n\nIf no title is defined here, the extension's [`[name]] will be used, if any."
},
"url": {
"type": "string"
}
},
"type": "object"
}