GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Copy MOVE HERE AS doesn't work from script


Copy MOVE HERE AS seems to ignore the HERE when called from a script.

Assume two folders with two files:



Select folder bar and execute

Copy MOVE HERE AS="foo"

from a button or as a direct command. The result is as expected:


Now execute the same from a script:

function OnClick(clickData) {
    var cmd = clickData.func.command;
    cmd.RunCommand('Copy MOVE HERE AS="foo"');

The folder bar will appear as foo in the destination with bar.txt in it.

It's not meant to be like this, or is it?


It's a side effect of how the HERE argument is handled internally. It's only looked at if the function doesn't have a destination path specifically defined, but when the command is launched from a script it does.

You can probably get the same result with cmd.SetDestTab(cmd.sourcetab);.


Ah, yes, works!
The subtleties of scripting :slight_smile: