I have already used the results property to do what I want. For example, I created a save dialog and used the location returned.savePath = DOpus.Dlg.Folder("Where to Store?", "D:\\Sandbox\\Depot", false, myTab)
if (savePath.result) {
//Do Something ...
}
I discovered a situation where if a user of my current script has an archive that already has the name that was previously used, Opus prompts like it does natively. If I wanted to display a dialog like it is giving it would look something like thisdlg = DOpus.Dlg
dlg.message = "Simple dialog message"
dlg.title = "Dialog Title" dlg.buttons = "Merge|Replace|Cancel"
// could get the result by using below
ret = dlg.result
/ret would then equal 1, 2, or 0 // is what I picked up from documentation
But I did not write the code to display this dialog (pic), and it is perfect because Opus did it for me. To be clear it is simply giving me what Opus does when a archive exists. It seems like a good idea to use what Opus does for me. So I am imagining there must be a “results” property from the last message that was thrown from Opus. The term last message is what I use to describe the message that I did not instantiate from Opus scripting objects. Is there a way to work with messages that Opus will create or a way to turn these off? Thanks
Results from dialogs that Opus commands create are not passed back to scripts in general. Commands generally only pass back information about the overall operation they performed, not intermediate decisions.
Depending on exactly what you're aiming for, you may be able to achieve it by having the script display a similar dialog (if it detects it is needed), and then passing arguments to the command to tell it the choice so that it behaves as desired without having to prompt, and then also using the dialog's result in whatever other way you need to in the script.
OK, that helps me understand. Picking the first two option are helpful to what I want accomplish. The only option from this Opus dialog that remains a problem is Cancel. That is because it continues (without creating an archive) when I would want to quit the script entirely. Now I am looking for a way to let the script know if no archive is made or changed don't continue with the rest of the commands. Thanks
Here's an example:
Function OnClick(ByRef clickData)
Set cmd = clickData.func.command
cmd.RunCommand "Copy ARCHIVE=.zip CREATEFOLDER=""test.zip"""
If (cmd.results.result = 0) Then
DOpus.Output "Command was aborted"
Else
DOpus.Output "Command ran at least partially"
End If
End Function
Oh, this makes sense the, the clickData.func.command has results when applicable. Great to know about! Thanks