GP SoftwareTwitter
Opus FAQsManualCommandsObjects

[Scripting] Set/change toolbar button image from a script

It seems that the Opus Scripting Interface doesn't support setting the toolbar button's image from a j/vb script?

I'm thinking about making the Downloads toolbar button which (when clicked leads to the Downloads folder but also) displays number of files in the Downloads folder right in its graphics (similar to notification overlays on icons on iOS). I could prepare the png graphics (some 100 images, with last one saying 99+ :slight_smile: ) and update the button periodically.

You can change the icon programmatically using the @icon command modifier.
I use this in the external compare and merge tools script. Where the user needs to provide the executable path for the selected compare tool. The path is stored in a global variable.
The default icon for the button is grey, if the global variable is set when you hold down the button it will show a colour icon, indicating it has a path.

The command for the buttons looks like this.

@icon:#ExternalCompare:BeyondCompare3,$glob:ExternalCompare+BeyondCompare3
ExternalCompare Product BeyondCompare3

Not sure if it can do what you want, but might get you on the right path. As you can control the icon with a variable, and you can set the variable in a script.

Your button might look like

@icon:#Downloads:Count1,$glob:DownloadsCount1
@icon:#Downloads:Count2,$glob:DownloadsCount2
@icon:#Downloads:Count3,$glob:DownloadsCount3
...
1 Like