-
Notifications
You must be signed in to change notification settings - Fork 0
/
_DOpusDefinitions.d.ts
8115 lines (6709 loc) · 325 KB
/
_DOpusDefinitions.d.ts
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
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
type DOpusCurrency = number;
/**
* If a script add-in provides an OnAboutScript method, it is passed an AboutData object when invoked via the user clicking the About button in Preferences.
*
* @see {DOpusOnAboutScript}
*/
interface DOpusAboutData {
/**
* This is a handle to the parent window that the script should use if displaying a dialog via the Dialog object. Even though this is not a Lister or Tab, it can still be assigned to the Dialog.window property to set the parent window of the dialog.
*/
readonly window: number;
}
/**
* If a script add-in implements the OnActivateLister event, the method receives an ActivateListerData whenever the window activation state of a Lister changes.
*
* @see {DOpusOnActivateLister}
*/
interface DOpusActivateListerData {
/**
* Returns True if this Lister is activating, False if deactivating. Note that if the activation moves from one Lister straight to another the script will be called twice.
*/
readonly active: boolean;
/**
* Returns a Lister object object representing the Lister that is closing.
*/
readonly lister: DOpusLister;
/**
* Returns a string indicating any qualifier keys that were held down by the user when the event was triggered.
*
* The string can contain any or all of the following: shift ctrl, alt, lwin, rwin
*
* If no qualifiers were down, the string will be: none
*/
readonly qualifiers: string;
}
/**
* If a script add-in implements the OnActivateTab event, the method receives an ActivateTabData object whenever the activation state of a tab changes.
*
* @see {DOpusOnActivateTab}
*/
interface DOpusActivateTabData {
/**
* Returns a Tab object representing the tab that has become active.
*/
readonly newTab: DOpusTab;
/**
* Returns a Tab object representing the tab that has gone inactive.
*/
readonly oldTab: DOpusTab;
/**
* Returns a string indicating any qualifier keys that were held down by the user when the event was triggered.
*
* The string can contain any or all of the following: shift ctrl, alt, lwin, rwin
*
* If no qualifiers were down, the string will be: none
*/
readonly qualifiers: string;
}
/**
* The AddCmdData object is passed to the OnAddCommands event in a script add-in . The script can use this to add internal commands using the AddCommand method.
*
* @see {DOpusOnAddCommands}
*/
interface DOpusAddCmdData {
/**
* Adds a new internal command to Opus. The returned ScriptCommand object must be properly initialized. A script add-in can add as many internal commands as it likes to the Opus internal command set.
*/
addCommand(): DOpusScriptCommand;
}
/**
* The AddColData object is passed to the OnAddColumns event in a script add-in . The script can use this to add columns using the AddColumn method.
*/
interface DOpusAddColData {
/**
* Adds a new information column to Opus. The returned ScriptColumn object must be properly initialized. A script add-in can add as many columns as it likes, and these will be available in file displays, infotips and the Advanced Find function.
*/
addColumn(): DOpusScriptColumn;
}
/**
* If a script add-in implements the OnAfterFolderChange event, the method receives an AfterFolderChangeData object once the folder read is complete.
*
* @see {DOpusOnAfterFolderChange}
*/
interface DOpusAfterFolderChangeData {
/**
* Returns a string indicating the action that triggered the folder read. The string will be one of the following: * **normal, refresh, refreshsub, parent, root, back, forward, dblclk.**
*
* The refreshsub actions means the folder (and sub-folders) are being refreshed while Flat View is on. The other action names should be self-explanatory.
*/
readonly action: string;
/**
* If the read failed, this will return a Path object representing the path that Opus tried to read.
*
* If the read was successful, this property is not provided - instead, the tab property provides access to this information.
*
* Use the result **property** to know if the read was a success.
*/
readonly path: DOpusPath;
/**
* Returns a string indicating any qualifier keys that were held down by the user when the event was triggered.
*
* The string can contain any or all of the following: shift ctrl, alt, lwin, rwin
*
* If no qualifiers were down, the string will be: none
*/
readonly qualifiers: string;
/**
* Returns True if the folder was read successfully, or False on failure.
*/
readonly result: boolean;
/**
* Returns a Tab object representing the tab that read the folder.
*/
readonly tab: DOpusTab;
}
/**
* An Alias object represents a defined folder alias . It is retrieved by enumerating or indexing the Aliases object.
*
* @see {DOpusAliases}
*
* @returns {string} Returns the name of the alias.
*/
interface DOpusAlias extends String {
/**
* Returns the target of the alias as a Path object.
*/
readonly path: DOpusPath;
/**
* True if the object is a system-defined alias, False if it is user defined.
*/
readonly system: boolean;
}
/**
* The Aliases object holds a collection of all the defined folder aliases . It is retrieved from the DOpus .aliases method.
*
* @see {DOpusConstructor}
*
* @returns {DOpusAlias} You can enumerate the Aliases object, or query the value of an individual alias by name (e.g. DOpus.Output(DOpus.aliases("desktop").path);)
*/
// interface DOpusAliases extends DOpusAlias {
interface DOpusAliases {
// // new <T = any>(safearray: SafeArray<T>): Enumerator<T>;
// // new <T = any>(collection: { Item(index: any): T }): Enumerator<T>;
// // new <T = any>(collection: any): Enumerator<T>;
// new <T = any>(safearray: SafeArray<DOpusAlias>): Enumerator<DOpusAlias>;
// new <T = any>(collection: { Item(index: any): DOpusAlias }): Enumerator<DOpusAlias>;
// new <T = any>(collection: DOpusAlias): Enumerator<DOpusAlias>;
/**
* Adds a new alias to the system with the specified name and path. Note that you should not provide the leading forward-slash (/) in the alias name.
*/
add(name?: string, path?: string): void;
/**
* Deletes the specified alias.
*/
delete(name?: string): void;
/**
* Updates the state of this object. When the Aliases object is first retrieved via DOpus.aliases, a snapshot is taken of the aliases at that time. If you make changes via the object it will reflect them but any changes made outside the script (e.g. via the Favorites ADD=alias command) will not be detected unless you call the Update method.
*/
update(): void;
}
interface DOpusArgsHelper {
/**
* The got_arg property returns an object with a bool child property for each argument in the template. It lets you test if a particular argument was provided on the command line, before you actually query for the value of the argument. For example, If Args.got_arg.size Then...
*/
readonly [key: string]: boolean;
}
/**
* The Args object is passed to a script when it is invoked via a command, via the Func .args property. It is used when a command added by a script has a command line template and provides access to any arguments provided on the command line.
*
* @see {DOpusFunc}
*/
interface DOpusArgs {
/**
* The Args object will have one property corresponding to each of the arguments in the command line template.
*
* For example, if the command line template is NAME/K,SIZE/N, the Args object would have two properties, called name and size.
*
* The type returned by each property is also defined by the template. In the above example, name would return a string and size an int.
*
* A /S argument returns a bool, a /N argument returns an int, and all other argument types return a string. Note that a /O argument will also return a bool if no string value is provided on the command line.
*
* If an argument is marked in the template as /M (multiple) then it returns a Vector containing elements of the appropriate type.
*
* If an argument was not provided on the command line by the user, its property will either return bool (for a /S or /O argument), or an empty variant otherwise. */
// readonly [key: string]: boolean | number | string | DOpusVector<boolean | number | string>;
readonly [key: string]: boolean | number | string | DOpusVector<boolean | number | string> | DOpusArgsHelper;
/**
* The got_arg property returns an object with a bool child property for each argument in the template. It lets you test if a particular argument was provided on the command line, before you actually query for the value of the argument. For example, If Args.got_arg.size Then...
*/
readonly got_arg: DOpusArgsHelper;
}
/**
* The AudioCoverArt object provides access to an audio file's embedded cover art. It is obtained through the AudioMeta .coverart property.
*
* @see {DOpusAudioMeta}
*
* @returns {string} Returns a string indicating the intended use for this cover art. Possible values are:
*
* *artist, back, band, bandlogo, colorfulfish* (this is unfortunately part of the ID3 specification), *composer, conductor, front, icon, illustration, leadartist, leaflet, location, lyricist, media, other, otherfileicon, performance, publisherlogo, recording, vidcap.*
*/
interface DOpusAudioCoverArt extends String {
/**
* Returns a Blob object representing the actual image data.
*/
readonly data: DOpusBlob;
/**
* Returns the bit depth of this image.
*/
readonly depth: number;
/**
* Returns the description of this image (if any).
*/
readonly desc: string;
/**
* Returns the default file extension for this image, if it can be determined.
*/
readonly ext: string;
/**
* Returns the height of this image, in pixels.
*/
readonly height: number;
/**
* Returns the image's MIME type, if specified in the file.
*/
readonly mime: string;
/**
* Returns a FileSize object representing the size of the image data.
*/
readonly size: DOpusFileSize;
/**
* Returns a "pretty" form of the intended use string (i.e. the default value), translated to the current Opus user interface language.
*/
readonly type: string;
/**
* Returns the width of this image, in pixels.
*/
readonly width: number;
}
/**
* The AudioMeta object is retrieved from the Metadata .audio or Metadata .audio_text properties. It provides access to metadata relating to sound files.
*
* @see {DOpusMetadata}
*/
interface DOpusAudioMeta {
/**
* Album
*/
readonly mp3Album: any;
/**
* Album artist
*/
readonly mp3AlbumArtist: any;
/**
* Artists
*/
readonly mp3Artist: any;
/**
* Audio codec
*/
readonly audioCodec: any;
/**
* Audio codec
*/
readonly mp3Type: any;
/**
* BPM
*/
readonly mp3Bpm: any;
/**
* Bit depth
*/
readonly picDepth: any;
/**
* Bit rate
*/
readonly mp3Bitrate: any;
/**
* Compilation
*/
readonly compilation: any;
/**
* Composers
*/
readonly composers: any;
/**
* Conductors
*/
readonly conductors: any;
/**
* Copyright
*/
readonly copyright: any;
/**
* Disc number
*/
readonly mp3Disc: any;
/**
* Disc number
*/
readonly mp3Disk: any;
/**
* Duration
*/
readonly mp3SongLength: any;
/**
* Encoded by
*/
readonly mp3Encoder: any;
/**
* Encoding Software
*/
readonly mp3EncodingSoftware: any;
/**
* Genre
*/
readonly mp3Genre: any;
/**
* Initial key
*/
readonly initialKey: any;
/**
* Mode
*/
readonly mp3Mode: any;
/**
* Music comment
*/
readonly mp3Comment: any;
/**
* Music info
*/
readonly mp3Info: any;
/**
* Music title
*/
readonly mp3Title: any;
/**
* Protected
*/
readonly mp3Drm: any;
/**
* Release date
*/
readonly releaseDate: any;
/**
* Sample rate
*/
readonly mp3Samplerate: any;
/**
* Track number
*/
readonly mp3Track: any;
/**
* Year
*/
readonly mp3Year: any;
/**
* Returns a collection of AudioCoverArt objects representing any cover art imagery stored in the audio file.
*
* The default value of this property returns the number of cover art images - for performance reasons, you should check whether this is greater than 0 before enumerating or accessing individual items in the collection.
*/
readonly coverArt: DOpusAudioCoverArt;
}
/**
* If a script add-in implements the OnBeforeFolderChange event, the method receives a BeforeFolderChangeData object before the new folder is read.
* @see {DOpusOnBeforeFolderChange}
*/
interface DOpusBeforeFolderChangeData {
/**
* Returns a string indicating the action that triggered the folder read. The string will be one of the following: normal, refresh, refreshsub, parent, root, back, forward, dblclk.
*
* The refreshsub actions means the folder (and sub-folders) are being refreshed while Flat View is on. The other action names should be self-explanatory.
*/
readonly action: string;
/**
* Returns True if this is the first path to be read into this tab (i.e. previously the tab was empty).
*/
readonly initial: boolean;
/**
* Returns a Path object representing the new path that is to be read.
*/
readonly path: DOpusPath;
/**
* Returns a string indicating any qualifier keys that were held down by the user when the event was triggered.
*
* The string can contain any or all of the following: shift ctrl, alt, lwin, rwin
*
* If no qualifiers were down, the string will be: none
*/
readonly qualifiers: string;
/**
* Returns a Tab object representing the tab that is changing folder.
*/
readonly tab: DOpusTab;
}
/**
* A Blob object represents a chunk of binary data. Scripting languages like VBScript and JScript have no built-in support for binary data - this object can be used to allocate a chunk of memory and manipulate it in a similar way to low-level languages like C. You can use Blob objects in conjunction with the File object to read or write binary data from or to disk files.
*
* Blob objects are convertible to and from two types of ActiveX arrays - a SAFEARRAY of type VT_UI1 (known as an array ) and a SAFEARRAY of type VT_VARIANT, with each variant holding a VT_UI1 (known as a VB array ). You can initialize a Blob with either of these two types of array (either when creating it via the DOpusFactory.Blob method or with the Blob.CopyFrom method), and you can also convert a Blob back to an array with the ToArray and ToVBArray methods. Support for these array types is dependent on the scripting language.
*
* You can read and write individual bytes within the Blob by indexing the byte offset starting from 0. For example, my_blob(5) = 128 would set the value of the sixth byte in the blob to 128.
*
* @see {DOpusFile}
*/
interface DOpusBlob {
/**
* Returns a FileSize object representing the size of this Blob in bytes.
*/
readonly size: DOpusFileSize;
/**
* Compares the contents of this Blob against another Blob (or array). By default the entire contents of the two blobs are compared. The optional parameters that let you configure the operation are:
*
* * **to** - specifies the byte offset within this Blob to compare against. Defaults to 0.
* * **from** - specifies the byte offset within the source Blob to compare with. Defaults to 0.
* * **size** - specifies the number of bytes to compare. Defaults to the full size of the source Blob.
*
* The return value is 0 if the two blobs are the same. A value of -1 indicates this blob is less than the other blob, and 1 indicates this blob is greater than the other blob.
*/
compare(source?: DOpusBlob, to?: number, from?: number, size?: number): number;
/**
* Copies data from the source Blob (or array) into this Blob. By default the entire contents of the source Blob will be copied over the top of this one. The optional parameters that let you configure the operation are:
*
* * **to** - specifies the byte offset within this Blob to copy to. Defaults to 0.
* * **from** - specifies the byte offset within the source Blob to copy from. Defaults to 0.
* * **size** - specifies the number of bytes to copy. Defaults to the full size of the source Blob.
*
* As well as copying from another Blob, you can use this method to initialise a Blob from a string. By default the Blob will be set to the Unicode form of the string; if you pass "utf8" as the second parameter it will initialise the Blob with the UTF8-encoded form of the string.
*
* If this Blob is not currently large enough to contain the copied data it will be resized automatically.
*/
copyFrom(sourceOrString?: DOpusBlob | string, toOrType?: number | string, from?: number, size?: number): void;
/**
* Searches the contents of this Blob for the data contained in another Blob (or array). By default the entire contents of this Blob are searched. The optional from parameter lets you specify the starting position for the search, and the optional size parameter lets you specify the length of data in this Blob to search through.
*
* The return value is -1 if the search data were not found, otherwise the offset from the start of the Blob data is returned.
*/
find(search?: DOpusBlob, from?: number, size?: number): DOpusFileSize;
/**
* Frees the memory associated with this Blob and resets its size to 0.
*/
free(): void;
/**
* Initialises the contents of the Blob (every byte within the blob will be set to 0). Equivalent to Set(0).
*/
init(): void;
/**
* Resizes the Blob to the specified number of bytes.
*/
resize(size?: number): void;
/**
* Reverses the contents of the Blob.
*/
reverse(): void;
/**
* Sets the contents of the Blob to the specified byte value (every byte within the blob will be set to that value). By default the whole Blob will be affected. The option to parameter lets you specify a byte offset to start at, and the optional size parameter lets you control the number of bytes affected.
*/
set(value?: number, to?: number, size?: number): void;
/**
* Converts the contents of this Blob to a SAFEARRAY of type VT_UI1. By default the entire contents of the Blob will be copied to the array. The optional parameters that let you configure the operation are:
*
* * **from** - specifies the byte offset within the source Blob to copy from. Defaults to 0.
* * **size** - specifies the number of bytes to copy. Defaults to the full size of the source Blob.
*/
toArray(from?: number, size?: number): object;
/**
* Converts the contents of this Blob to a SAFEARRAY of type VT_VARIANT. Each variant in the array contains a VT_UI1. By default the entire contents of the Blob will be copied to the array. The optional parameters that let you configure the operation are:
* * **from** - specifies the byte offset within the source Blob to copy from. Defaults to 0.
* * **size** - specifies the number of bytes to copy. Defaults to the full size of the source Blob.
*/
toVBArray(from?: number, size?: number): object;
}
/**
* A BusyIndicator object lets you control the breadcrumbs bar busy indicator from your script.
*
* By default a busy indicator simply indicates that something is happening; it can also be used to indicate the progress of a job (percentage complete from 0% to 100%). The user can click the spinning circle to see a description of the jobs that are running, and each job can optionally allow the user to abort it by displaying an Abort link they can click.
*
* BusyIndicator objects are created using the DOpusFactory.BusyIndicator method. The basic steps for using one in your script are:
*
* 1. Create the object by calling DOpus.Create.BusyIndicator() .
*
* 2. Optionally set the abort property to True to enable user aborting.
*
* 3. Call the Init method to initialize and display the busy indicator.
*
* 4. Call the Update method when needed to update the progress or explanatory text.
*
* 5. Poll the abort property to check for user abort if desired.
*
* 6. Call the Destroy method to remove the busy indicator when the job is complete.
*/
interface DOpusBusyIndicator {
/**
* Before the Init method has been called, you can set this property to True to enable abort by the user (as shown above). After Init has been called, this property will return True if the user has clicked the Abort link.
*/
readonly abort: boolean;
/**
* Removes the busy indicator from display and destroys its internal data structures. The BusyIndicator object itself can be re-used by calling the Init method again.
*/
destroy(): void;
/**
* Removes the busy indicator from display, but does not destroy its internal data. The indicator can be re-displayed by calling the Show method.
*/
hide(): void;
/**
* Initializes a BusyIndicator object and optionally displays it. The window parameter specifies the Lister that the indicator is to be attached to - you can pass either a Lister or a Tab object.
*
* The optional description parameter lets you specify a text string that is displayed to the user when they click the spinning circle.
*
* The optional visible parameter lets you make the indicator visible immediately by passing True. Alternatively, call the Show method to make the indicator visible.
*/
init(window?: object, description?: string, visible?: boolean): boolean;
/**
* Displays the busy indicator.
*/
show(): void;
/**
* Updates the busy indicator. The description parameter lets you specify a new description string, and the optional percentage parameter lets you specify a new percentage complete value from 0 to 100.
*/
update(description?: string, percentage?: number): void;
}
/**
* The ClickData object is passed to the OnClick method in a script function.
* @see {DOpusOnClick}
*/
interface DOpusClickData {
/**
* Returns a Func object relating to this function. This provides access to information about the function's environment - (source and destination tabs, qualifier keys, etc).
*/
readonly func: DOpusFunc;
}
/**
* If a script add-in implements the OnCloseLister event, the method receives a CloseListerData object before a Lister is closed.
* @see {DOpusOnCloseLister}
*/
interface DOpusCloseListerData {
/**
* Returns a Lister object representing the Lister that is closing.
*/
readonly lister: DOpusLister;
/**
* Set this to True to prevent the closing Lister from being saved as the new default Lister.
*/
readonly prevent_save: boolean;
/**
* Returns a string indicating any qualifier keys that were held down by the user when the event was triggered.
*
* The string can contain any or all of the following: *shift ctrl, alt, lwin, rwin*
*
* If no qualifiers were down, the string will be: none
*/
readonly qualifiers: string;
/**
* Returns True if the Lister is closing because Opus is shutting down.
*/
readonly shutdown: boolean;
}
/**
* If a script add-in implements the OnCloseTab event, the method receives a CloseTabData object when a tab is closed.
* @see {DOpusOnCloseTab}
*/
interface DOpusCloseTabData {
/**
* Returns a string indicating any qualifier keys that were held down by the user when the event was triggered.
*
* The string can contain any or all of the following: *shift ctrl, alt, lwin, rwin*
*
* If no qualifiers were down, the string will be: none
*/
readonly qualifiers: string;
/**
* Returns a Tab object representing the tab that is closing.
*/
readonly tab: DOpusTab;
}
/**
* The Column object represents an information column displayed in a tab (e.g. name, size, attributes, etc). A collection of Column objects can be retrieved from the Format .columns property.
* @see {DOpusFormat}
*
* @returns {string} Returns the name of the column.
*/
interface DOpusColumn extends String {
/**
* Returns True if the column width is set to auto.
*/
readonly autosize: boolean;
/**
* Returns True if the column width is set to collapse.
*/
readonly collapse: boolean;
/**
* Returns True if the column width is set to expand.
*/
readonly expand: boolean;
/**
* Returns True if the column width is set to fill.
*/
readonly fill: boolean;
/**
* Returns the name of the column as displayed in the Lister column header.
*/
readonly header: string;
/**
* Returns the name of the column as displayed in the Columns tab in the Folder Options dialog.
*/
readonly label: string;
/**
* Returns the maximum width of the column in pixels, or the string "fill" if the maximum is set to fill.
*/
readonly max: number | string;
/**
* Returns the name of the column.
*/
readonly name: string;
/**
* Returns True if the sort direction of the column is reversed.
*/
readonly reverse: boolean;
/**
* Returns the sort order of the column (e.g. 1 for the primary sort field, 2 for the secondary sort field, etc). Returns 0 if the display is not sorted by this column.
*/
readonly sort: number;
/**
* Returns the current display width of the column in pixels.
*/
readonly width: number;
}
/**
* The Command object is used by a script to run Opus commands. Any command that you can run from a button or hotkey you can run from a script - a script can even run commands added by other scripts . Fundamentally, using the Command object is similar to configuring an Opus button. You add one or more command lines to the object just the same as you add one or more command lines to a button's function. You can tell it which files and folders to act upon, and you can use the various methods and properties of the object to modify the behavior of the command. Once the object has been initialized you can use the Run or RunCommand methods to invoke the command.
*
* A Command object can be created by the DOpusFactory.Command method. By default, this object has no source, destination, files to operate on, etc. - you must use the appropriate methods to configure the command before running it. You can also retrieve a Command object from the Func .command property, and in this case the source, destination, files to operate on and several other properties are pre-initialized for you.
*/
interface DOpusCommand {
/**
* Set this property to False to prevent files used by this command from being deselected, and True to deselect them once the function is finished. Note that files will only be deselected if they came from a Tab object, and only then if the command is successful.
*/
deselect: boolean;
/**
* Returns a Path object that represents the destination folder of this command. If a destination tab is set, this will be the path in the tab. You can not set this property directly - instead, use either the SetDest or SetDestTab methods to change the destination folder.
*/
readonly dest: DOpusPath;
/**
* Returns a Tab object that represents the destination tab for this command (if it has one - not all commands require a destination). You can not set this property directly - instead, use the SetDestTab method to change the destination tab.
*/
readonly destTab: DOpusTab;
/**
* Returns the number of items in the files collection.
*/
readonly fileCount: number;
/**
* Returns a collection of all Item objects that represent the files and folders this command is to act upon. You can not modify this collection directly - instead you can use the various methods (ClearFiles, SetFiles, AddFile, RemoveFile, etc.) to modify the list of items to act upon.
*/
readonly files: DOpusItem;
/**
* Returns the number of instruction lines added to the command.
*/
readonly lineCount: number;
/**
* Returns a Progress object that you can use to display a progress indicator to the user.
*/
readonly progress: DOpusProgress;
/**
* After every command that is run with this object, a Results object is available from this property. This provides information about the outcome of the command.
*/
readonly results: DOpusResults;
/**
* Returns a Path object that represents the source folder of this command. If a source tab is set, this will be the path in the tab. You can not set this property directly - instead, use either the SetSource or SetSourceTab methods to change the source folder.
*/
readonly source: DOpusPath;
/**
* Returns a Tab object that represents the source tab for this command. You can not set this property directly - instead, use the SetSourceTab method to change the source tab.
*/
readonly sourceTab: DOpusTab;
/**
* This Vars object represents all defined variables with command scope (that are scoped to this function - e.g. that were set using the @set directive).
*/
readonly vars: DOpusVars;
/**
* Adds the specified item to the collection of items this command is to act upon. You can pass the item's path as either a string or a Path object, and you can also pass an Item object directly.
*
* This method returns the total number of items in the collection.
*/
addFile(pathStringOrPathOrItem?: string | DOpusPath | DOpusItem): number;
/**
* Adds the items in the specified collection to the list of items this command is to act upon. The return value is the new number of items in the collection.
*
* You can also pass a Vector of Item or Path objects, or of strings (full paths), instead of a collection.
*/
addFiles(): number;
/**
* Adds the contents of the clipboard to the collection of items this command is to act upon. This method supports both files and file paths copied to the clipboard as text. The return value is the new number of items in the collection.
*/
addFilesFromClipboard(): number;
/**
* Reads file paths from the contents of the specified file and adds them to the item collection. You can provide the file's path as either a string or a Path object. The file must consist of one absolute path per line.
*
* The encoding of the file is assumed to be ANSI, unless it has a BOM (byte-order-mark) at the start, or you specify the encoding argument. If you specify the encoding this must be a string equal to one of the following: utf16be, utf16le, utf8, ansi or cp:XXXX where XXXX specifies the code page number).
*
* The return value is the new number of items in the collection.
*/
addFilesFromFile(path?: string, encoding?: string): number;
/**
* Adds the contents of the specified folder to the collection of items this command is to act upon. You can pass the folder's path as either a string or a Path object. You can also append a wildcard pattern to the path to only add files matching the specified pattern.
*/
addFilesFromFolder(path?: string): number;
/**
* Adds the specified instruction line to the command that this object will run. The AddLine method lets you build up complicated multiple line commands - add each line in turn and then run the command using the Run method. For a single line command it is simpler to use the RunCommand method.
*/
addLine(instruction?: string): void;
/**
* Clears all instruction lines from the command.
*/
clear(): void;
/**
* Clears the failure flags from the Item collection. Any items that fail when a command is run will have their failed property set to True, and once this has happened the file will be skipped over by any subsequent commands. You can call this method to reset all the failure flags.
*/
clearFailed(): void;
/**
* Clears the collection of items this command is to act upon.
*/
clearFiles(): void;
/**
* Clears any modifiers that have been set for this command. The supported modifiers are a subset of the full list of command modifiers - see the SetModifier method for a list of these. You can also pass * to clear all modifiers that have been set.
*/
clearModifier(modifier?: string): void;
/**
* Returns a StringSet containing the names of all the Opus commands. You can optionally filter this set by providing one or more of the following flags as an argument to the CommandList method:
*
* * **i** - internal (built-in) commands
* * **s** - script commands
* * **u** - user commands
*/
commandList(types?: string): DOpusStringSet;
/**
* Creates a new Dialog object, that lets you display dialogs and popup menus. The dialog's window property will be automatically assigned to the source tab.
*/
dlg(): DOpusDialog;
/**
* Returns a Map of the modifiers that have been set for this command (either by the SetModifier method, or in the case of script add-ins any modifiers that were set on the button that invoked the script).
*/
getModifiers(): DOpusMap;
/**
* Returns True if the specified Set command condition is true. This is the equivalent of the @ifset command modifiers. The optional second parameter lets you test a condition based on a command other than Set - for example, IsSet("VIEWERCMD=mark", "Show") in the viewer to test if the current image is marked.
*/
isSet(condition?: string, command?: string): boolean;
/**
* Removes the specified file from the Item collection. You can pass the file's path as either a string or a Path object. You can also pass the Item itself, or its index (starting from 0) within the collection. The return value is the new number of items in the collection.
*/
removeFile(path?: string | DOpusPath, item?: DOpusItem, index?: number): number;
/**
* Runs the command that has been built up with this object. The return value indicates whether or not the command ran successfully. Zero indicates the command could not be run or was aborted; any other number indicates the command was run for at least some files. (Note that this is not the "exit code" for external commands. For external commands it only indicates whether or not Opus launched the command. If you need the exit code of an external command, use the WScript.Shell Run or Exec methods to run the command.) You can use the Results property to find out more information about the results of the command, and also discover which files (if any) failed using the failed property of each Item in the files collection.
*/
run(): number;
/**
* Runs the single line command given by the instruction argument. Calling this method is the equivalent of adding the single line with the AddLine method and then calling the Run method.
*/
runCommand(instruction?: string): number;
/**
* Sets the command's destination to the specified path. You can provide the path as either a string or a Path object. Calling this method clears the destination tab property from the command.
*/
setDest(path?: string): void;
/**
* Sets the command's destination to the specified tab. The destination path will be initialized from the tab automatically (so you don't need to call SetDest as well as SetDestTab).
*/
setDestTab(tab?: DOpusTab): void;
/**
* Configures the command to use the files in the specified Item collection as the items the command will act upon.You can also pass a Vector of Item objects instead of a collection.
*/
setFiles(): void;
/**
* Turns on a modifier for this command. The supported modifiers are a subset of the full list of command modifiers:
*
* *admin, async, codepage, externalonly, leavedoswindowopen, nodeselect, noexpandenv, nofilenamequoting, nolocalizefiles, noprogress, norunbatch, resolvelinks, runmode*
*
* Using this method is the equivalent of using the AddLine method to add the modifier to the command as an instruction; e.g. Command.SetModifier("async") is the same as Command.AddLine("@async"). If the modifier requires a value it is passed as the second argument, e.g. Command.SetModifier("runmode", "hide").
*/
setModifier(modifier?: string, value?: string): void;
/**
* Lets you share the progress indicator from one command with another command. You can pass this method the value of progress property obtained from another Command object.
*/
setProgress(progress?: DOpusProgress): void;
/**
* This method lets you control which qualifier keys the command run by this object will consider to have been pressed when it was invoked. For example, several internal commands change their behavior when certain qualifier keys are held down - calling this method allows you to set which keys they will see.
*
* The qualifiers argument must consist of one or more of the following strings (comma-separated): *none, shift, ctrl, alt, lwin, rwin, win.*
*/
setQualifiers(qualifiers?: string): void;
/**
* Sets the command's source to the specified path. You can provide the path as either a string or a Path object. Calling this method clears the source tab property from the command.
*/
setSource(path?: string): void;
/**
* Sets the command's source to the specified tab. The source path will be initialized from the tab automatically (so you don't need to call SetSource as well as SetSourceTab).
*/
setSourceTab(tab?: DOpusTab): void;
/**
* Sets the type of function that this command will run. This is equivalent to the drop-down control in the Advanced Command Editor. The type argument must be one of the following strings: std, msdos, script, wsl. Standard (std) is the default if the type is not specifically set.
*/
setType(type?: string): void;
/**
* This method can be used to update the appearance of toolbar buttons that use @toggle:if to set their selection state based on the existence of a global-, tab- or Lister-scoped variable. You would call this method if you have changed such a variable from a script to force buttons that use it to update their selection status.
*/
updateToggle(): void;
}
declare var Command: DOpusCommand;
/**
* If a script add-in implements the OnScriptConfigChange event, the method receives a ConfigChangeData object whenever the user modifies the script's configuration via the Preferences editor.
* @see {DOpusOnScriptConfigChange}
*/
interface DOpusConfigChangeData {
/**
* Returns a Vector containing the names of the configuration items that were modified.
*/
readonly changed: DOpusVector<string>;
}
/**
* The Control object represents a control on a script dialog ; it lets you read and modify a control's value (and contents). Use the Dialog .Control method to obtain a Control object.
* @see {DOpusDialog}
*/
interface DOpusControl {