-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.lcdoc
458 lines (239 loc) · 10.8 KB
/
api.lcdoc
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
Library: org.openxtalk.library.macosnativeapptools
Type: library
Summary: This Library is a collection of macOS Cocoa and AppKit related FFI wrappers.
Description:
A collection of macOS Cocoa AppKit related handlers
>*Note:* This library is MIT licensed (permissive).
> Please share and share a like.
version: 1.0.2
author: Paul McClernan
Name: setAppToLightMode
Type: handler
Syntax: setAppToLightMode()
Summary: Assign the macOS native "Vibrant Light Mode" appearance style to all app windows
Example: setAppToDarkMode
Description: This sets an Apps appearance to Light Mode, with all app windows inheriting the dark appearance
Name: setWindowToDarkMode
Type: handler
Syntax: setWindowToDarkMode(<pWindowID>)
Summary: Assign the macOS native "dark mode" window style to a stack's window
Example: setWindowToDarkMode the windowID of this stack
Parameters:
windowID: retrieved from a stack's windowID property.
Description: This handler will set the macOS dark appearance of the window passed.
Name: SetHFSCreatorCodeOfFile
Type: handler
Syntax: SetHFSCreatorCodeOfFile(<pPathToFile>,<pFourCharOSType>)
Summary: Sets the Mac HFS Creator Code of a file.
Parameters:
pFilePath: Path to the file to examine.
pFourCharOSType: An 'OSType' four character creator code, such as 'WILD' or 'OXTk'
Returns: true on success, otherwise false
Description:
Sets the Mac HFS Creator Code of a file. A creator code is a four-character
'OSType' code, such as 'WILD' or 'OXTk, used to associate an application with
a file for legacy classic macOS files.
NOTE:
Mac HFS Type and Creator Codes are legacy macOS classic file system attributes
which have long been marked as 'deprecatred' by Apple, however since this potentially
effects many legacy files, Apple has included HFS Type and Creator in the
contemporary APFS file system.
Name: SetHFSTypeCodeOfFile
Type: handler
Syntax: SetHFSTypeCodeOfFile(<pPathToFile>,<pFourCharOSType>)
Summary: Sets the Mac HFS Type Code of a file.
Parameters:
pFilePath: Path to the file to examine.
pFourCharOSType: An 'OSType' four character type code, such as STAK or JFIF
Returns: true on success, otherwise false
Description:
Sets the Mac HFS Type Code of a file. A type code is a four-character
OSType code, such as MIDI or TIFF, used to associate a file type with a file for
legacy classic macOS files, which did not use filename extensions to detirmine a files type.
NOTE:
Mac HFS Type and Creator Codes are legacy macOS classic file system attributes
which have long been marked as 'deprecatred' by Apple, however since this potentially
effects many legacy files, Apple has included HFS Type and Creator in the
contemporary APFS file system.
Name: setAppToDarkMode
Type: handler
Syntax: setAppToDarkMode()
Summary: Assign the macOS native "Vibrant Dark" appearance style to all app windows
Example: setAppToDarkMode
Description:
This sets an Apps appearance to Dark Mode, with all app windows inheriting the
dark appearance.
NOTE your existing stacks may need to be edited for a proper look when in darkMode.
Name: IsFullScreenAllowed
Type: handler
Syntax: IsFullScreenAllowed(<windowID>)
Summary: Returns the mac native Full Screen behavior state of stack's window.
Example: if IsFullScreenAllowed(the windowID of this stack) then put "Ready to go mac native full screen."
Parameters:
windowID: retrieved from a stack's windowID property.
Returns: The mac native Full Screen allowed state of a stack's window.
Description:
Geven the windowID of a stack this returns the mac native Full Screen behavior
state of the stack.
Name: PostUserNotification
Type: handler
Syntax: PostUserNotification(<postTitle>,<subTitle>,<informativeText>,<postIdentifier>,<soundName>)
Summary: Creates macOS notification center notes
Example: PostUserNotification "Download Completed", "freelibs.net", "Your download of macOS.lce is completed", "DLNote001", "sosumi"
Parameters:
postTitle: title of the notification
subTitle: subtitle of the notification
informativeText: The body text of the notification
postIdentifier: identifier for a notification, usefull for overwriting
soundName:
name of a sound in the system
pass empty for no sound, pass "default" for default "ding" sound
Description:
Creates macOS notification center notes.
String values should be localized as it is presented to the user.
String values for postTitle and subTitle truncated to a length appropriate for
display and it's properties modified to reflect any truncations.
For soundName Pass empty for silent or pass any sound file in any of the OS
Library/Audio/Sounds folders, if no match is found a default alert sound is used.
Name: FullScreenAllowed
Type: handler
Syntax: FullScreenAllowed(<windowID>,<isAllowed>)
Summary: Sets the mac native fullscreen attribute for a windowID passed to it.
Example: FullScreenAllowed the windowID of this stack, TRUE
Parameters:
windowID: retrieved from a stack's windowID property.
isAllowed: If true then allow, if false don't allow.
Description:
This handler will set the mac native Full Screen behaviour on the windowID passed.
Depending on the OS version, this will either display an icon in the window’s
top-right corner, or change the maximize button to display double arrows.
Name: RequestUserAttention
Type: handler
Syntax: RequestUserAttention(<criticalRequest>)
Summary:
When the app is in the background, RequestUserAttention calls for user
attention by bouncy the App's icon in the Dock
Example:
do "tell application "& quote & "Finder.app" & quote & " to activate" as AppleScript
wait 1 second with messages
RequestUserAttention TRUE
Parameters:
criticalRequest:
Set wether or not attention is immediately needed.
- TRUE: the user attention request is a critical request. The dock icon will
continue to bounce until the application is brought forward.
- FALSE: the user attention request is an informational request.
The dock icon will bounce once.
Description:
When the app is in the background <RequestUserAttention> will call for the users
attention by bouncy the App's icon in the Dock. If <criticalRequest> is false it will
bounce the icon only once, otherwise the icon will continue to bounce until
the app is the active foreground app.
Name: SetDockTileBadge
Type: handler
Syntax: SetDockTileBadge(<badgeText>)
Summary: Badge the App's Dock Icon with a small string of text.
Example: setDockTileBadge "Hello"
Parameters:
badgeText: a small string of text to badge the app's dock icon with.
Description:
Badge the App's Dock Icon with a small string of text. If badgeText string is
too long it will be automatically truncated to fit.
Name: RevealFileInFinder
Type: handler
Syntax: RevealFileInFinder(<pFilePath>)
Summary: Reveals a file or folder in the Finder.
Parameters:
pFilePath: Path to the file or folder to reveal.
Returns: Boolean
Name: GetFrontmostApplication
Type: handler
Syntax: GetFrontmostApplication(<pReturnType>)
Summary: Returns information about the frontmost application.
Parameters:
pReturnType: `ProcessID`, `Path`,`BundleID`, empty
Returns: Requested return type or a return delimited list
Name: MiniaturizeAll
Type: handler
Syntax: MiniaturizeAll()
Summary: Minimize all document windows (does not effect on modal dialogs or modeless palette windows)
Example: MiniaturizeAll
Description:
Minimize all document windows (does not effect on modal dialogs or modeless palette windows).
This is the programatic equivelant to option-clicking the yellow minimize button on the windowframe
Name: AppHide
Type: handler
Syntax: AppHide()
Summary: Hides the app sending it in the background and activates the next active app.
Example: AppHide
Description:
Hides the app, sending it in the background and activates the next active app.
This is the programatic equivelant to selcting Hide from the app's Dock menu.
Name: getNSWindowFrameRect
Type: handler
Syntax: getNSWindowFrameRect(<pWindowID>)
Summary: Get the real rect of a stack's window including decorations and titlebar.
Example: put getNSWindowFrameRect( the windowID of this stack ) into message
Parameters:
pWindowID: retrieved from a stack's windowID property.
Description:
Gets the actual rect of a stack's window on macOS, including the windows decorations,
titlebar, etc. This will likely be a different in height than a stacks rect property
( 19 pixel height differnece for a palette window type for example).
NOTE:
macOS system use bottom/left start point and height/width size to define a
windows rect.
Name: GetHFSCreatorTypeCodesOfFile
Type: handler
Syntax: GetHFSCreatorTypeCodesOfFile(<pPathToFile>)
Summary: retrieves Mac HFS Creator and Type Codes Of File.
Parameters:
pPathToFile: Path to the file to examine.
Returns: A two-line list. Line 1 is creator code. Line 2 is the file type code, or empty property is not set.
Description:
Retrieves the Mac HFS (Hierarchial File System) creator and type codes of a file.
Returns empty if the file does not have HFS type codes set, otherwise a two-line
list will be returned. Line 1 is creator code. Line 2 is the file type code.
NOTE:
Mac HFS Type and Creator Codes are legacy macOS classic file system attributes
which have long been marked as 'deprecatred' by Apple, however since this potentially
effects many legacy files, Apple has included HFS Type and Creator in the
contemporary APFS file system.
Name: ToggleFullScreen
Type: handler
Syntax: ToggleFullScreen(<windowID>)
Summary: Toggle the mac native Full Screen state of a stack's window
Example: ToggleFullScreen the windowID of this stack
Parameters:
windowID: retrieved from a stack's windowID property.
Description:
This handler will toggle the Full Screen state of the window passed.
The FullScreenAllowed must first be enabled for this to work (system requirement)
Name: GetRunningApplications
Type: handler
Syntax: GetRunningApplications()
Summary: Returns a information about running applications as a line demilited list.
Returns:
Returns a line delimited list of information about the currently
running applications as a line demilited list.
Name: GetrCurrentUserHome
Type: handler
Syntax: GetrCurrentUserHome()
Summary: Returns the users home directory as URL and as a Path.
Returns: Users home directory as a URL string and as a Path string seperated by a newline.
Name: setWindowToLightMode
Type: handler
Syntax: setWindowToLightMode(<pWindowID>)
Summary: Assign the macOS native "light mode" window style to a stack's window
Example: setWindowToLightMode the windowID of this stack
Parameters:
windowID: retrieved from a stack's windowID property.
Description: This handler will set the macOS "light" appearance of the window passed.
Name: AppUnhide
Type: handler
Syntax: AppUnhide()
Summary: Unhides the app revealing any document windows that were hidden.
Example: AppUnhide
Description:
Unhides the app revealing any document windows that were hidden, but it does not
activate the app which remains in the background.