Script Miscellaneous

Shell Properties

Opus 12 has new script support for Windows shell properties, making it easy for a script to enumerate properties in the system and retrieve the properties for a file.

Below is an example script that adds columns to Opus that show the value of shell properties for DWG (AutoCAD) files added by a third party tool.

Function OnInit(initData)
initData.name = "DWG Columns"
initData.desc = "Adds DWG Columns from the JTB World extension"
initData.copyright = "(c) 2016 jpotter"
initData.version = "1.0"
initData.default_enable = true
initData.min_version = "12.0.8"
    Dim props, prop, col
Set props = DOpus.FSUtil.GetShellPropertyList("dwg.*", "r")
    for each prop in props
        Set col = initData.AddColumn
col.name = prop.raw_name
col.method = "OnDWGColumn"
col.label = prop.display_name
col.justify = "left"
col.autogroup = true
col.userdata = prop.pkey
next
End Function
Function OnDWGColumn(scriptColData)
scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)
End Function

 

Viewer Events

There is a new OnViewerEvent script event, which is called when certain events occur in a standalone image viewer.

One possible use would be a script that automatically displays a floating toolbar whenever a standalone viewer is active, and hides it again when the window goes inactive or closes.

 

 

Copy Queue scripting

The new OnGetCopyQueueName script event lets a script override the copy queue name for automatically-managed copy queues. This lets you implement your own copy queue logic if desired.

The event function is passed a GetCopyQueueNameData object containing information about the copy operation as well as the default queue name. Your function can return a new queue name, or return False to accept the default name. If your function returns True the queue will be bypassed and the operation will run immediately.