Copy into multiple selected destinations

Share script buttons and script add-ins to extend and modify Opus.
User avatar
Posts: 36498
Joined: 07 Nov 2004, 01:30
OS: Windows 10 64-bit
Opus: Directory Opus 12
Location: London, UK
  • Overview:

    This script-button copies the selection from the source side in to each selected folder on the destination side.

    Before clicking the button:
    100dpi_wc8817_dopus.png (29.85 KiB) Viewed 262 times

    After clicking the button:
    100dpi_wc8818_dopus.png (36.22 KiB) Viewed 262 times

  • Download:

    If you download button in .dcf format, you can drag & drop it straight to your toolbars. See near the end of How to add buttons from this forum to your toolbars.

    Copy to selected.dcf
    (1.54 KiB) Downloaded 50 times

  • Script code:

    Here is the script code, to help those using the forum to find scripting techniques. You do not need to use or understand any of this if you just wish to use the button.

    100dpi_wc8819_dopus.png (45.21 KiB) Viewed 262 times


    Code: Select all

    function OnClick(clickData)
       var source = clickData.func.sourcetab;
       var dest   = clickData.func.desttab;
       var cmd    = clickData.func.command;
       cmd.deselect = false; // Leave source files selected.

       if (typeof dest != "object"
       ||   dest.selected_dirs.count == 0
       ||   source.selected.count == 0)
          clickData.func.dlg.Request("Need selections on both sides.","OK");

       for (var e = new Enumerator(dest.selected_dirs); !e.atEnd(); e.moveNext())
          cmd.AddLine("Copy TO=\"" + e.item().RealPath + "\"");


Return to “Script Buttons & Add-Ins”