DopStack

dopus_Op9d9nynty dopus_LpUnBgQYdH

About:
A Script AddIn which replicates the Drop Stack feature from OSX's Pathfinder. The new command DopStack will open a dialog (remembering it's position). You can drop files and folders from any Lister onto this dialog (the Stack) and they will be added to the Clipboard automatically. This allows you to build up a list of copied files and folders from multiple locations which you can then paste anywhere. Similar to a collection in DOpus but using the clipboard only (You can output the stack to a collection as well - see below).

Configuration:
DopStack is configurable from the Preferences / Toolbars / Scripts page.

  • DopStack Options:

    • archive_format: From the dropdown select the archive format used to compress the stack.
    • confirm_exit: Prompts for confirmation if the stack contains items.
    • default_save_load_path: Default path used to save or load a .stack file.
    • remember_position: DopStack remembers its last used size and position.
    • stack_label_text: Default text used to name the stack.
    • stay_on_top: Keep the dialog on top of all other windows.
  • DopStack Theme:

    • background_colour: Change the background colour (use hexidecimal).
    • clipboard_nomatch: Label highlight colour when clipboard doesn't match the stack.
    • stack_colour: From the dropdown select either a grey, light grey, red, yellow, blue, white or black file icon.
    • stack_label_bold: Use a bold font for the stack label.
    • stack_stats_bold: Use a bold font for the stack statistics.
    • target_colour: From the dropdown select either a grey, light grey, red, yellow, blue, white or black target icon.
    • target_style: Use the dropdown to select a style for the target icon.
    • text_colour: Change the text colour (use hexidecimal).
  • Stack Viewer Options:

    • dblclk_viewer: Use the dropdown to select what happens when an item is double clicked in the Stack Viewer.
    • extended_viewer_info: Show extended information in the Stack Viewer.
    • group_viewer_list: Group files and folders in the Stack Viewer.
    • icon_mode: Open the Stack Viewer in icon mode.
    • remember_position_viewer: The Stack Viewer remembers its last used size and position.
    • text_editor_label: The label for the text editor button.
    • text_editor_path: The path to your preferred text editor.
  • Stack Viewer Theme:

    • files_bg_colour: Text background colour for files.
    • files_fg_colour: Text foreground colour for files.
    • folders_bg_colour: Text background colour for folders.
    • folders_fg_colour: Text foreground colour for folders.
    • viewer_colour: Background colour for the Stack Viewer list.

If there's an error with any of the colour or path configuration options a small yellow icon will appear in the top right of the DopStack main dialog:

dopus_rj7tbJVXPQ

Left click this icon to open a new dialog showing all configuration items which have caused an error. This dialog is resizable and will remember it's size and position.

History:

  • 1.5.3 (12/7/20)
    • Added: Custom dialog to display configuration errors with more information.
    • Fixed: No longer adds duplicate items when pasting items to the stack.
    • Fixed: Now kills clipboard check timer when not required to help with parsing speed.
Older
  • 1.5.2 (23/6/20)
    • Added: You can save the stack from the exit confirmation dialog.
    • Added: Config option (remember_position) to toggle whether DopStack remembers its last used size and position.
    • Added: Config option (remember_position_viewer) to toggle whether the Stack Viewer remembers its last used size and position.
    • Change: Changes to the command arguments – now using ADDTOSTACK instead of ADDSELECTED. If used alone, ADDTOSTACK will add all selected files in the source folder to the stack. Options for ADDTOSTACK include allsource, alldestination and selecteddestination.
    • Removed config option ADDSELECTED.
    • Added: Paste option in main dialog. Paste any files/folders in the clipboard into the stack.
  • 1.5.1 (20/6/20)
    • Fixed: The last update broke the ability to change the stack name from within the DopStack dialog.
    • Exit confirmation dialog now reports total items in the stack.
    • More redundant code removed (I wonder what I've broken this time...).
  • 1.5 (19/6/20)
    • Added: Stacks can be saved to or loaded from disk. Saved Stacks are simple text lists containing the full path to each item. The save/open dialogs use a config option (default_save_load_path) to determine the starting location.
    • Added: Icon mode for the Stack Viewer (icon_mode), you can also toggle between modes (details and icon) from the Stack Viewer itself.
    • Added: You can drop items onto the Stack Viewer to add items to the Stack.
    • Added: Now uses a Save dialog for the Compress to Archive function.
    • Added: Config checking now includes items that use a path (text_editor_path, default_save_load_path).
    • Fixed: Problems would occur if a file in the stack had been deleted but not removed from the stack. Now the stack will monitor and remove any deleted items automatically.
    • Various code cleanups, bug fixes.
  • 1.4.7 (14/6/20)
    • Added: You can now drag individual items from the Stack Viewer to any valid location.
    • Added: Grouping now works in the basic Stack Viewer (if group_viewer_list is set to true) as well as in the Extended Info view.
  • 1.4.6 (12/6/20)
    • Fixed: Now ignores missing # in hexidecimal colour configuration options.
    • Added: Checks all hex colour configuration options for valid hexidecimal numbers. If there's an error DopStack will use a default value for that option.
  • 1.4.5 (11/6/20)
    • Added: Grouping in the Stack Viewer list (files and folders).
    • Added: Configuration option (group_viewer_list) to toggle grouping.
    • Added: Group checkbox in Stack Viewer to toggle grouping.
    • Added: Theme support for the Stack Viewer (file and folder fg and bg colours, and list colour).
    • Added: Copy option to Stack Viewer menu - copies actual item from the list to the clipboard.
    • Fixed: Under some circumstances the clipboard matching check failed.
  • 1.4.4 (11/6/20)
    • Added: Confirmation prompt when exiting if there are items in the stack.
    • Fixed: About dialog now working correctly.
  • 1.4.3 (8/6/20)
    • Added: stack_stats_bold - Use a bold font for the stack statistics.
    • Added: Add source to Stack option (adds all items in current source tab to the stack regardless of selection status).
    • Fixed: Items added with the popup menu options (Add to...) didn't enable the Remove Last option.
    • Fixed: Clearing the filter resulted in a second refresh of the list.
    • Fixed: Stack Viewers' double-click and some menu items not working properly in extended info mode
    • Added: Stack Viewer menu now has 'Copy File Name' and 'Copy Full Pathname' options.
  • 1.4.2 (8/6/20)
    • Added: Extended viewer information - configuration item (extended_viewer_info) to toggle.
    • Fixed: Main dialog now updates with Stack details when removing an item from the viewer.
    • Added: About and Exit from the popup menu.
    • Added: Help button to launch resource centre url in About dialog.
  • 1.4.1 (2/6/20)
    • Added: Command line argument STACKLABEL to override the initial Stack Label from the configuration.
    • Added: Command line argument ADDSELECTED which will add all selected items in the source tab to the stack when DopStack first launches.
    • Added: New config option (add_selected) which will add all selected items in the source tab when DopStack first runs (default is false).
    • Fixed: text_editor_path failed if it contained quotes.
  • 1.4 (31/5/20)
    • Added: Drag from the dialog to copy your stack to any valid location (left button to copy, right button to copy or copy to new folder).
    • The "notepad" button in the Stack Viewer is now configurable, change it to your text editor of choice.
    • The filename used in both "Compress..." options is no longer hard coded, you will be prompted for a name.
    • Fixed: No longer disables "Empty collection" menu item when the stack is empty.
  • 1.3 (30/5/20)
    • Added: Stack Viewer.
    • Fixed: crash if DopStack was launched from a hotkey with no Listers open.
  • 1.2.2 (29/5/20)
    • Added: Checks if the clipboard is identical to the stack - if not the label is highlighted in a configurable colour (clipboard_nomatch in configuration).
  • 1.2.1 (29/5/20)
    • Added: Stack label - a user changeable label to make distinguishing between multiple instances of DopStack more obvious (suggested by @bytespiller).
    • Fixed: Progress dialog appearing in source lister when viewing stack in notepad.
    • Fixed: If dropped were files were already duplicated in the stack, the Remove Last option would remove matching files placed in the stack earlier.
  • 1.2 (29/5/20)
    • Added: Target styles (Scope, Cat).
    • Added: New colours for Target and Stack icons (light grey, yellow and blue).
    • Dialog is now resizable (will remember size and position).
    • View in Log option changed to View Stack which shows the current stack in notepad.
  • 1.1 (28/5/20)
    • Added: 'Remove Last' option which will remove the last items added to stack.
    • Added: 'Compress and email' option to compress and send all items via email.
    • Duplicate items are ignored when dragged to the stack (thanks @lxp for the tip).
  • 1.0.4 (27/5/20)
    • Fixed: Archives weren't being created correctly.
    • Added: Configuration option to choose archive format (zip, 7zip and rar).
  • 1.0.3 (27/5/20)
    • Changed the popup menu to activate on a right click.
    • Double clicking the dialog now copies the stack to the clipboard.
    • Separated file icon and target icon colour configuration.
  • 1.0.2 (27/5/20)
    • Added alternate image to display when stack isn't empty.
    • Hid the options button, so that left clicking anywhere in the dialog shows the popup menu.
  • 1.0.1 (27/5/20)
    • Added: Red crosshair.
    • Added: Add to Stack, Copy File Names and Copy Pathnames options in popup menu.
    • Added: Config option to choose whether the dialog stays on top.
    • Fixed: Compress to archive now notices if the source is a new lister for creation of the archive.
  • 1.0 (27/5/20)
    • Initial Release.

Installation:

  • Download: (1.5.3 requires DOpus 12.21) DopStack.osp (139.6 KB)
  • Drag the .js.txt file to Preferences / Toolbars / Scripts.

Usage:

  • Download: Dop Stack.dcf (677 Bytes)
  • Select "Settings / Customize Toolbar..." from your Lister and then drag the button file to any toolbar you like. Left click the button to open DopStack and if you're running DOpus 12.20.6 or better you can right click the button to open the configuration for DopStack.

Use the command line argument STACKLABEL to override the initial Stack Label in your configuration, which will be useful if you want to run multiple instances with preconfigured labels.
e.g: DopStack STACKLABEL="My Stack"
You can extend this further so that the button will ask for a stack label each time it's run:
DopStack STACKLABEL="{dlgstringS|Enter stack name|[default stack]}"

The command line argument ADDTOSTACK will force DopStack to add all selected items in the source tab to the stack.
e.g: DopStack ADDTOSTACK
Additional options are available for the ADDTOSTACK argument:
ADDTOSTACK=allsource: will add all source files/folders to the stack.
ADDTOSTACK=alldestination: will add all files/folders in the destination tab to the stack.
ADDTOSTACK=selecteddestination: will add all selected files/folders in the destination tab to the stack.

Open the dialog using the button above and then simply drag and drop files and folders from any Lister (or anywhere else that supports the dragging of files) to add them to the stack. When you're ready, simply select Paste in any Lister to copy all items from your stack. You can also drag from DopStack to copy your stack to any valid location (left button to copy, right button to copy or copy to new folder).

As you add files and folders to the stack, the numbers at the bottom of the dialog will show you the total counts.

The stack label will change colour (orange by default, but configurable) if the clipboard no longer matches the files in the stack (Whenever items are dragged and dropped on the dialog they are added to the clipboard automatically). Double click anywhere in the dialog (or use the Copy option in the popup menu) to re-copy the stack to the clipboard.

You can run as many DopStack instances as you like, allowing you to use multiple stacks.

Right click anywhere in the dialog to show a popup menu with these options:

  • Add Selected to Stack: Adds selected items in the current source Lister to the stack.
  • Add Source to Stack: Adds all items in the current source Lister to the stack.
  • Remove Last: Removes the last items added to the stack.
  • Remove All: Empty the stack and clear the clipboard.
  • Save Stack...: Saves the current stack as a plain text file.
  • Load Stack...: Loads a previously saved stack, the loaded stack will be added to the existing stack with any duplicates ignored.
  • Copy: Re-copies the stack to the clipboard (files and folders dragged to the target are automatically added to the clipboard).
  • Paste: Paste any files or folders in the clipboard into the stack.
  • Copy File Names: Copies names of items in the stack to the clipboard as text.
  • Copy Pathnames: Copies full paths of items in the stack to the clipboard as text.
  • Copy to Collection: Copies the stack to a DOpus collection (coll://DopStack). The collection will be created if it doesn't exist.
  • Empty Collection: Empties the collection (coll://DopStack).
  • Compress to archive: Creates a compressed file of all items in the stack (the archive format can be chosen in the configuration: archive_format. A file request dialog will prompt you for a filename.
  • Compress and email...: Compress all items in the stack and emails the archive (uses the COPY SENDMAIL command).
  • Stack Viewer...: Opens the Stack Viewer (see below).
  • Change Stack Label...: Change the label for this instance of DopStack.
  • About DopStack...: Information about DopStack.
  • Exit DopStack: Close the dialog and exit the script.

Stack Viewer:

The Stack Viewer allows you to view and manipulate the stack. You can filter the displayed items with the edit box at the top (clear it with the button). This filter has no effect on the stack, it's purely for display. Double click an item to perform the action chosen in the configuration options (dblclk_viewer). Possible options are (Show with DOpus viewer, Default Open action and View Properties).

By default the Stack Viewer will use Details mode, which can be enhanced with additional info, including size, modified date and attributes (use the extended_viewer_info option). Additionally, the Stack Viewer can be used in Icon mode (config option for this is icon_mode). In this mode the extended_viewer_info will be ignored.

Both Details and Icon mode allow grouped by File and Folder (option group_viewer_list).

Once the dialog is open you can toggle Icon/Details mode and Grouping On/Off.

Right click an item to show a popup menu with the following options:

dopus_i9yEP2oZyH

  • Open: Opens the item with the Default Open action.
  • Show: Show the item in the DOpus viewer.
  • Go to...: Open the current item in the source Lister (a new Lister will open if none exist). If the item is a file it will be selected in the Lister, if it's a folder it will just open the source Lister to that folder.
  • Copy: Copies the item to the clipboard.
  • Copy File Name: Copy the items file name to the clipboard as text.
  • Copy Full Pathname: Copy the items full path to the clipboard as text.
  • Properties: Show the Properties dialog for that item.
  • Remove from Stack: The selected item will be removed from the stack (there is no undo for this).
  • Clear Filter: If a filter is set for the viewer, this will clear it (the same as the Clear button).

The Notepad button will show the current stack in notepad.exe - or any configured text editor you prefer (both the button label and the editor path can be changed - see above).

17 Likes

Very neat!

3 Likes

Thanks Leo.

I really should hold off on posting scripts until I have finished adding and testing though - seem to have spent the day posting updates. :slight_smile:

This is amazing!

1 Like

New version, now with added :cat2:

image

3 Likes

What's missing? :slight_smile:

Being able to drag and drop FROM the dialog.

The real Drop Stack also utilises a mac control (I think) which shows a stack of icons for all files in the stack (using the real files icons) - no big deal - cosmetic only.

I probably worded that line badly - should have been:
"... as close as my skills will allow me to get it with the tools provided..." :smiley:

1 Like

One small suggestion for the DopStack: since we can have multiple DopStack windows opened at once, it would be neat if we could set a custom label to the DopStack windows to have a context/reminder of their contents.

The custom label could literally be an Edit Control that does nothing (or a menu entry that asks for a label and applies it to the window title bar).

Nice idea @bytespiller. I don't think you can modify a title bar once the dialog is shown (happy to be proved wrong on this one) so it would probably have to be a label control somewhere in the dialog.

Will have a play.

@bytespiller Try 1.2.1 which I've just uploaded. I've added a stack label in the dialog and you can change it from the new menu option (Change Stack Label). There's also a couple of new configuration options to toggle the bold font and the initial text shown. Does this work for you?

I guess the logical next step to this is to have multiple stacks in the one dialog with a dropdown selection for them, plus a way to create a new stack. This would add a huge level of complexity and a major rewrite so for now this it.

2 Likes

Thanks, that was fast! It's great, even better than title bar change! :+1:
This is now really a deluxe Add-In for Opus!

Yeah I know how it is, these things can grow more and more in scope and features (and development time!), and in the end the code goes from elegant to... less elegant :smiley:

I'd suggest to go easy and not overwork yourself, perhaps have another Add-In planned instead of rewriting this nice little Add-In which IMO should stay nice and elegant as it is (maybe small QoL touches here and there over time).

Some additional suggestions to think about when you'll find time:

  • Detection when the clipboard goes out of sync with the Stack: for example check every 500 ms and have a color change (configurable, perhaps orange by default) when the Stack is out of sync -- especially useful when using multiple Stack windows.
  • Built-in list of files (popup child window?) instead of opening a text file (but still perhaps the way it is now is more useful because filenames be copied more easily so I'm not 100% sure about this suggestion).
1 Like

Added in 1.2.2. Thanks.

1 Like

Added in 1.3.

1 Like

Oh wow this is awesome, it even has a filter-as-you-type filtering! This Add-In is now as polished as if it's original part of the Opus!

Who knows maybe in the future when there will be more such high quality Add-Ins, GPSoft could bundle a selection of Add-Ins officially in the Opus 13 or something like that :smiley:

EDIT: I see that the DopStack is mentioned in the Opus 12.20.6 beta changelog as an example! Nice! :+1:

2 Likes

Great list of changes for 12.20.6 - have drag and drop working from the dialog - works a treat - will get my teeth into the other changes properly tomorrow. No more hidden controls to handle clicking- nice!

Thanks @Jon /@Leo.

3 Likes

New version above (1.4) - requires DOpus 12.20.6.

1 Like
  • 1.4.1 (2/6/20)
    • Added: Command line argument STACKLABEL to override the initial Stack Label from the configuration.
    • Added: Command line argument ADDSELECTED which will add all selected items in the source tab to the stack when DopStack first launches.
    • Added: New config option (add_selected) which will add all selected items in the source tab when DopStack first runs (default is false).
    • Fixed: text_editor_path failed if it contained quotes.
1 Like

1.4.2

  • Added: Extended viewer information - configuration item (extended_viewer_info) to toggle.
  • Fixed: Main dialog now updates with Stack details when removing an item from the viewer.
  • Added: About and Exit from the popup menu.
  • Added: Help button to launch resource centre url in About dialog.

1.4.3

  • Added: stack_stats_bold - Use a bold font for the stack statistics.
  • Added: Add source to Stack option (adds all items in current source tab to the stack regardless of selection status).
  • Fixed: Items added with the popup menu options (Add to...) didn't enable the Remove Last option.
  • Fixed: Clearing the filter resulted in a second refresh of the list.
  • Fixed: Stack Viewers' double-click and some menu items not working properly in extended info mode
  • Added: Stack Viewer menu now has 'Copy File Name' and 'Copy Full Pathname' options.
1 Like

Outstanding work @Steve. Can I suggest an option for the user to be prompted on exit if the stack is not empty. It would be painful to collect a whole bunch of disparate items and then lose them all before doing anything with them thanks to a careless click on X.

2 Likes

1.4.4 added above which will now prompt for exit if the Stack contains items. You can turn this behaviour off from the "confirm_exit" configuration item. This only works if you exit DopStack from the popup menu.

I can't see a way to interrupt the dialog close if the user clicks the windows close button, by the time the script realises it's clicked, the dialog is closed so it won't prompt if you use the close button. Not ideal but unless I've missed something in the docs....