DOpus

The DOpus object is one of the two global script objects provided by Opus, and is available to all scripts. It provides various helper methods, and collections that let you access things like Listers and toolbars.

 

Property Name

Return Type

Description

aliases

object:Aliases

The Aliases object gives the script access to the defined folder aliases.

Note: The first time a script accesses this property, a snapshot is taken of all current aliases. If the script then makes changes to aliases, these changes will not be reflected by this collection. To re-synchronize the collection call the DOpus.aliases.Update method.

language

string

Returns a string representing the current user interface language.

listers

collection:Lister 

Returns a collection of Lister objects representing all currently open Listers.

Note: The first time a script accesses this property, a snapshot is taken of all currently open Listers. If the script then opens or closes Listers itself, these changes will not be reflected by this collection. To re-synchronize the collection, call the DOpus.listers.Update method.

The listers collection also has a LastActive method which provides quick access to the currently active, or most recently active, Lister window.

toolbars

collection:Toolbar 

Returns a collection of Toolbar objects representing all defined toolbars (whether they are currently open or not).

vars

object:Vars 

This Vars object represents all defined variables with global scope.

version

object:Version 

The Version object provides information about the current Opus program version.

 

Method Name

Arguments

Return Type

Description

ClearOutput

none

none

Clears the script output log.

Create

none

object:DOpusFactory 

Creates and returns a new DOpusFactory object, which can be used to create various lightweight helper objects like Blob, Map and Vector.

Delay

<int:time>

none

Delays for the specified number of milliseconds before returning.

Dlg

none

object:Dialog

Creates a new Dialog object, that lets you display dialogs and popup menus.

FSUtil

none

object:FSUtil 

Creates a new FSUtil object, that provides helper methods for accessing the file system.

GetClip

none

or <string:type>

string
or collection:Item 

Retrieves the current contents of the system clipboard, if it contains either text or files.

You can control the returned type by passing either "text" or "files" for the <type> argument - Opus will convert to the requested type if possible.

If <type> is not specified the contents will be returned in their native format.

GetClipFormat

none

string

Returns a string indicating the native format of the clipboard contents - "text", "files" or an empty string in any other case.

Output

<string:text>
<bool:error>

none

Prints the specified text string to the script output log (found either in the Utility Panel or in the CLI in script mode).

If the second argument is provided and set to True, the message will be displayed as an error. This means the text will be displayed in red and if no log windows are currently open, a warning icon will flash in the Lister status bar to alert the user of an error condition.

ReloadScript

<string:file>

none

Causes Opus to reload and reinitialize the specified script. You must provide the full pathname of the script on disk (if a script add-in wants to reload itself you can pass the value of the Script.file property).

SetClip

<string:text>
or collection:Item
or none

none

Places the specified text, or Item collection (or Vector of Item objects) on the system clipboard. If called with no arguments the clipboard will be cleared.