GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Confirm multi-open (Add-In)


#1

Description:
This script Add-In will make Directory Opus ask you to confirm before opening more than X (configurable, 20 is default) selected items by keyboard Enter key.


I was inspired to make this script Add-In when it happened that I had about 200 high-resolution HD images selected and accidentally pressed Enter (workflow sequence derailed) and then chaos ensued: IrfanView (fastest image viewer for Windows) instances started multiplying and soon computer became unresponsive (mouse froze) from so much load (RAM was quickly filled and paging-fest started) for several long minutes (I didn’t want to reset the computer so I waited).

Now this kind of things shall never happen again!

Installation

  1. download ConfirmMultiopen.js.txt (attachment below)
  2. in your Directory Opus go to Settings > Preferences… then Toolbars > Scripts
  3. now simply drag & drop downloaded ConfirmMultiopen.js.txt to the Preferences window, and that’s it!

Usage
There is nothing special you need to do, after installation this Add-In is immediately active. See Changing Settings below to configure it to your needs.

Changing Settings
You can configure this Add-In by going to Settings > Preferences… then Toolbars > Scripts and then selecting Confirm multi-open Add-In in the list and clicking its Configure button.

  • Threshold setting: for example if threshold is 20 you’ll get prompted to confirm (screenshot above) in the event that more than 20 selected files/folders are to be opened at once. You can set it to any value, even 0.

  • Excluded extensions setting: list of name endings (you are not limited to pure extensions) which will not count toward the threshold limit (remove the example extensions from the list before adding your real ones).

  • Focus button setting: lets you change which button (Proceed or Cancel) is to be focused when confirmation prompt is triggered. Default is Proceed so when confirmation dialog pops-up you can just press Enter again to proceed.

Uninstalling
You can manage Add-Ins in Directory Opus Preferences; Settings > Preferences… then Toolbars > Scripts.

Download Version 1.1 - Added “Excluded extensions” feature. Opus version 11.10.2 or higher is required.
ConfirmMultiopen.js.txt (9.76 KB)


Opening Multiple Files
Use selected file count in opus command
Killer Features of Pro
#2

is it possible to disable the response to double-click by middle mouse button?


#3

I’ve checked the Opus scripting docs and it appears there is currently no support for Add-Ins to find out which mouse button triggered the OnDoubleClick event.

@Leo, Jon: is it possible for you to add some kind of mouse button index property to the DoubleClickData object (similar to “qualifiers” for keys)?
Also while we’re at it, is it possible to implement support for Add-Ins to detect whether the OnDoubleClick was triggered by keyboard Enter/Return key?


#4

+1

…o)


#5

This is now implemented/fixed in new version of this Add-In (v1.0.2). You can find download in the first post which I’ve edited.
Note that updated Opus version 11.10.2 or higher is required.


:opusicon: Thanks to GPSoft for adding the mouse property to the DoubleClickData object in new Opus beta making this possible! :thumbsup:


#6

Minor update v1.0.3 - ScriptWizard support was added.
You can find the download link of this newer 1.0.3 version in the first post above.


#7

jsys… can you hear me? o)

Does the OnClickData.call feature work for you? I noticed in a similar script, that it doesn’t matter wether I set it to true/false.
OnDoubleClick() will be called for all the other items as well, I installed your script test-wise and it’s the same. The confirmation comes up again, if you have chosen to continue, which is not the way it’s meant to work I guess.


#8

I’ve checked and this doesn’t happen on my current version of Opus which is 11.13.

I now see here that this is happening to you in the latest beta and for txt files. Now, does it happen for any kind of files (such as pdf, which I’ve tried) and does it happen for folders too?


#9

It is not related to a specific filetype I think. I use the current beta. Strange thing is, a test-script provided by leo also fails for me. It might be something related to other scripts I have running, though I cannot remember having much else using OnDoubleClick(), will need to investigate more. Thanks for taking the time to try and respond! o)


#10

Nice script. I have one suggestion. Could you include an exception list, so we could exclude, for example, MP3 files?


#11

Good idea! I will add this feature.


#12

Feature update 1.1: added Excluded extensions setting. You can now specify list of name endings (so you are not limited to pure extensions) which will not count toward the threshold limit (you can/should remove the example extensions from the list before adding your real ones). This behaves like using asterisk (*) wildcard prefix (no wildcards or regex is actually supported).

I did some testing (actually more testing than coding :grin: ) and it seems it works fine. Let me know if any bugs are discovered.

You can find the download link of this newer 1.1 version in the first post above.


#13

It works perfectly here. Thanks, that was quick! :slight_smile:


#14

Maybe the plugin could use some sort of whitelist or blacklist? Initially i have suggested this feature, because adding MP3s to foobar shouldn’t trigger the confirm action. But what if i would not want xrecode (some format conversion tool) to open multiple instances, as it would do now? Of course i know, that i shouldn’t open lots of files in xrecode, making it a minor problem, but maybe it’s a good feature idea anyway?


#15

Thanks for the feedback and suggestions so far!

Determining which tool would open the selected files sounds tricky (maybe it’s not?), and anyway it seems to me that this feature would stray outside the scope of this particular add-in which is intented to be as simple (and general) as possible :slight_smile:


#16

No problem. Eventually i found a setting in xrecode to prevent multiple instances.


#17

I have yet to experience such an accident, but it might be a good safety precaution. Thank you.

It good to see sign of life here.