Script Functions

Script Functions are defined directly in a button or menu - they provide a third type of button function alongside Standard Function and MS-DOS Batch Function.

        Script Function.png

The screenshot above is an example of a script function that selects all "high-definition" images in the current source file display (which are defined as images with a vertical resolution greater than or equal to 1080 pixels).

The @script directive at the top is used to specify the scripting language - VBScript is assumed if this isn't specified. For example, @script:jscript would specify a JScript script.

 

The OnClick function is a defined script entry point that Opus will call whenever your button is clicked (or hotkey is pressed). The ClickData object passed to it provides a number of properties and methods that you can use to interact with the Lister that launched the function.