The following is a small AREXX script to open a Workbench window for all selected directories in Directory Opus 4.x.
DOpus4-OpenWindow.rexx
wherever you see fit (it is tidy, for example, to create an ARexx
directory in DOPUS4:
and then place your scripts there).Project→Configure
Open Window
, for example) and create a new entry.ARexx
and click the magnifying glass to enter the path to the DOpus4-OpenWindow.rexx
script.Select one or more directories in Directory Opus and click the button to open a Workbench window for all selected directories.
/* * $VER: DOpus4-OpenWindow 1.0 (03 Dec 2021) by Wizardry and Steamworks * * © 2021 Wizardry and Steamworks * * PROGRAMNAME: * DOpus4-OpenWindow * * FUNCTION: * Opens a Workbench window from selected directories. * * USAGE: * ARexx command DOpus4-OpenWindow.rexx (from DOpus) * * $HISTORY: * * 03 Dec 2021 : 1.0 : initial release */ Opus = Address() /* Get the DOpus address. */ Options RESULTS /* Request results. */ Address value Opus /* Use the DOpus address. */ Busy On Status 3 /* Get this window. */ ThisWindow = RESULT /* Get this window's selected items. */ TopText "Getting this window's items..." GetSelectedAll '*' ThisWindow /* Split entries by delimiter since we may have spaces. */ ThisItems = RESULT If ThisItems = 'RESULT' Then /* If no items in this window then bail. */ Do TopText "No items selected in this window!" Busy Off Exit End /* Normalize, heh... */ AllItems = Translate(Translate(ThisItems, '/', ' '), ' ', '*') Count = Words(AllItems) Do i = 1 To Count ThisName = SubWord(AllItems, i, 1) /* If the file is not selected, then skip it. */ If Find(AllItems, ThisName) = 0 Then Iterate i /* Restore original spaces. */ FullName = Translate(ThisName, ' ', '/') /* Get the path to the entry. */ Status 13 i + 1 Path = RESULT /* Compose the directory name. */ FilePath = Path||FullName /* Scroll to the item. */ ScrollToShow Translate(ThisName, ' ', '/') /* Open the directory. */ Address workbench WINDOW '"'FilePath'"' OPEN FRONT /* Don't deselect if operation failed. */ If RC ~= 0 Then Iterate i /* Deselect entry. */ SelectEntry i - 1 ||' '|| 0 ||' '|| 1 End TopText "(>*.-)/ There you go!" Busy Off Exit