Catalog Feature - Single Instance Open Option

Features wanted...
Post Reply
TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Catalog Feature - Single Instance Open Option

Post by TheQwerty »

Currently when you use a catalog entry to open multiple files the program is called once for each file.

I'd like the ability to have it call the program once with a list of all files.

What I'd like to see is one of the following:
1) The ability to mark a catalog entry as "Force Single Instance" or "Send Multiple List Items As One."
2) An additional option (and ability to make it the default drop action) that sends the group of selected files in a single call.


Why would I like to see this? Well, I'm sure it's not the only case but it's the one that always gets me.

I use Textpad ( http://www.textpad.com ) as a Notepad replacement, and it has the ability to open multiple files in a single instance. In addition, I can set it to allow multiple instances and this allows me to have multiple instances of Textpad each with any number of files open, which is extremely useful for grouping files and keeping things organized.

If I use XYplorer to open multiple files via the catalog entry I end up with an instance of Textpad for every file. If I drop the selection on my quick launch shortcut or the Textpad.exe I get a single instance with the selected files open. The latter is what I'd like to be able to accomplish with just XYplorer.

I'd also imagine that something like this might be needed for use with a number of other programs as well (perhaps archiving, FTP, or file difference programs?).


What do the rest of you think? Is this something anyone else would like to see? More importantly is this something that is possible Don?

badams007
Posts: 54
Joined: 15 Apr 2007 17:59
Location: Oregon, USA

Post by badams007 »

I think perhaps you are describing something that has frustrated me for years with Win Exp.

I use NoteTab <http://www.notetab.com/>. I have never figured out the pattern, but now that you mention it I guess it is: can open more than one file into one instance of NoteTab **ONLY** if I open them from within NoteTab. It would be nice to do same from within XY, etc. Hightlight files and right click, open with NoteTab and boom...all open in that one instance of NoteTab. I wonder if it would be possible somehow.

Is that what you mean or should I go back to sleep? ;)

Brenda

admin
Site Admin
Posts: 65456
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

badams007 wrote:I wonder if it would be possible somehow.
Me too. It's indeed an interesting question.

When XY open multiple files with an app, it does this:

app.exe file1
app.exe file2
app.exe file3

So the opened file is a start parameter of the app. Every app supports this AFAIK. Then as you observed, some app opens a new instance at each call, some loads the next file into the existing instance.

An alternative to be tested would be:
app.exe "file1" "file2" "file3"

I'll report back...

UPDATE: yep, seems to work. I can control it (tested only for UltraEdit!) the way described above for an app that allows multiples instances and multiple files in a single instance.
An app that only allows multiples instances (like notepad) will only open the first passed file. An app that only allows a single instance (like Photoshop AFAIK) will always open all files in a single instance regardless of the parameter.

Good. Remains the question of the UI: how should I best incorporate this option?? (Today I have no time to think about it -- maybe you come up with something...)

Gandolf

Post by Gandolf »

The problem that occurs with multiple opening is the length of the command line. If I have a path like "C:\Documents and Settings\HP_Owner\Documents\Definitions of the SI units The binary prefixes_files\" then it doesn't take many documents in that folder before the open command line exceeds the maximum that windows will allow. One file manager I know gets round it by splitting the command line if it is two long and then opens a second (and if necessary third etc...) instance of the program to pass all the files. Just a thought for you to mull over.

Also, a prompt that multiple files are to be opened, with a user defined threshold. It's a bit late with 1000 files selected when it starts to open them - I know, I've done it with images and you usually can't stop the process.

Linkaday
Posts: 387
Joined: 06 Aug 2007 14:40
Location: Hamburg, Germany - Win 11 Home v24H2 x64 1920x1080 (100%)

Post by Linkaday »

With those tabbed editors allowing multiple instances as well as multiple files in a single instance it's often an option in preferences of the target program that makes the difference: "use window", "Don't start multiple instances" or the like. Just tested it with PSPad, RJ TextEd v4 and EditPadPro. Can only test NoteTab later at home (i faintly remember that there is such an option in NoteTab too).

Yet Gandolf's objection is to consider.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

This is precisely what I'm asking for.

What I think might make the most sense is to add it as an option for each catalog entry which changes the drop action.
Perhaps have the option:
Open Selected List Item(s):
x - Individually
x - As a Group
And make the first option the default so it behaves as it does now.

In addition, add another item to the catalog context menu so there would be:
Open Selected List Item(s)
Open Selected List Item(s) as Group

As for the command limitations, I'm not sure how to best handle this, but I think I'd prefer it just gave me a "Too many files" error and didn't attempt to open them. I really don't like the idea of it splitting the group up and opening an instance for each limit unless I'm asked first and allowed to cancel. Then I can cancel and slim down my selection and try again. If the error message can be descriptive enough to suggest how far over the limit I've gone all the better.

If there's not currently a confirmation prompt when the user attempts to open a large number of files at once there should be. Not so sure it needs to be a user defined threshold or just sensibly picked, but I tend to agree with the power users' sentiments that user defined is always better.

I imagine that the process should be:
1) User selects multiple files.
2) User uses Catalog context menu or drag and drop to open files as group per options above.
3) Confirmation prompt if more files than the threshold. "Are you sure?"
4) Yes - Generate the command(s).
5) If command is less than limit, execute. Else error message:
"Too many files selected to be opened.
This action cannot be completed as desired.
Would you like to:
x - Open the program multiple times, each with the maximum number of files. (Do whatever it takes to open all files.)
x - Open the program just once, using the maximum number of files. Files after: xxx.xxx will not be opened. (Only open as many files as we can with one call.)
x - Cancel"

Hopefully someone else can come up with some better wording for the displayed text. :P

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

Linkaday wrote:With those tabbed editors allowing multiple instances as well as multiple files in a single instance it's often an option in preferences of the target program that makes the difference: "use window", "Don't start multiple instances" or the like. Just tested it with PSPad, RJ TextEd v4 and EditPadPro. Can only test NoteTab later at home (i faintly remember that there is such an option in NoteTab too).

Yet Gandolf's objection is to consider.
While that's an option (in Textpad too) it's not at all how I want to use the program.

I like to have different instances and in each only open files that relate to each other. This way I can open a group of data files in one instance and the code that manipulates them in another and not get lost (quite as easily :lol: ).

It also makes it a lot easier when you're working and then need to make changes on a bunch of files. I can keep my work where it is, open a new instance with every file that needs changed, make my changes, and close the file. I know I'm done when they're all closed and I don't have to worry about closing the files I was working on before.

Forcing a single instance is an option, but I'd rather just not use XYplorer for opening groups of files than give up my current methods. :wink:

Gandolf

Post by Gandolf »

@Linkaday:
I always run all my editors in the open in multiple tabs option, NoteTab certainly has multiple tabs (I'm not sure about the free version).

@TheQwerty:
I see your point about not splitting between separate instances of the editor (or whatever the opening program is) without asking. It's never bothered me and I often open with a number of long file paths which results in more than one instance of the editor open.

I don't know if I like the:
"x - Open the program just once, using the maximum number of files. Files after: xxx.xxx will not be opened. (Only open as many files as we can with one call.)"
option unless it is going to display a list of the files that will and will not be opened, which I doubt is practical.

The annoying thing about a pre-set limit is what to make it. One program I use has a limit of 5 (or 6, I don't remember which) and I always want to open 7 files - one for each day of the week.

Linkaday
Posts: 387
Joined: 06 Aug 2007 14:40
Location: Hamburg, Germany - Win 11 Home v24H2 x64 1920x1080 (100%)

Post by Linkaday »

@TheQwerty
Sorry, i was blinded by the light - seeing kind of workaround until Don comes up with just another surprise. :D

I was used to successfully drag a few files as grouping A to say EditPad catalog item and to pull grouping B on to say NoteTab (works like the above mentioned) as well as one grouping to both - but just to that extent (served all my needs up to now).

So i missed your point somewhat.

admin
Site Admin
Posts: 65456
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

Well, Qwerty et al., things here are getting a bit complicated it seems. Adding this feature would add more problems (necessity to think, to configure, to choose) than solutions to the app -- this, plus Gandolf's caveat: nope, I rather leave everything as it is.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

@Linkaday: It's all good. I actually considered writing a wrapper program that just collected the list from XYplorer and then opened Textpad. But figured I'd see if I could get Don to do the work instead. :lol:

@Gandolf: What I was thinking for that particular option is a bit confusing honestly. But it would basically take the selection as currently displayed and in the same order construct the call. If it hits the limit it prompts with that dialog and the file name shown would be the last one in the call. As it creates the call in the same order as displayed the user would be able to then look at their selection and adjust it.

Granted there are holes in this. It probably doesn't currently construct the calls in the same order as displayed. If the user has folders selected and the call would end in the middle of the folder it's a pain to adjust the selection. It's rather difficult to word well in a small dialog box.

I was just thinking of the three use cases (All, Some, None) and won't miss it if that option wasn't included, or if it's worded like "Open the program with the first limit files" and doesn't mention the file name.


I agree about hard-coded limits, but for the non-Advanced users the more options there are the more confusing it gets. As this limit is just deciding when to warn the user that the action they're about to perform could bring their system to a crawl/deadlock, about the only option I think it would need is "Don't Warn Me Again." Perhaps there could be an INI tweak that allows power users to continue to be warned if they so desire for x number of files to catch themselves in case of accidents.


EDIT: Awww.. :( Guess I'd better get working on that wrapper then.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

Nope.. I'm not giving in that easy. :P

I just wanted to add some new findings to this and propose it with some changes.

The current implementation is not the same as Windows Explorer. If I drop multiple files directly onto an exe within Explorer (or for that matter the list of XYplorer) it generates it as a single call. While the difference is the catalog, I'd think most people view the category and the Quick Launch toolbar as very similar. In which case the action is still different as dropping onto a Quick Launch shortcut acts the same as within Explorer.

Also, Windows handles the error of the call being too long with a dialog stating, "Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item." No call is ever made to the program as a result of this and no other options are given.

Currently there does not appear to be any warning when you choose to open a lot of files. I tried with 400 files and received no warning before it spawned 400 calls and thus copies of my test executable. As the current model calls the EXE for each file instead of once I'd say it's more in need of such a warning than what I'm proposing.


The reason it was becoming too complicated is because we were making it such. All those options aren't needed, so let me propose the idea again, but in a way that closely resembles Windows Explorer.

I suggest the following:
Add a GUI option to the Catalog Item Properties:
"Open Selected List Item(s):
x - Individually
x - As a Group"

Add "Open Selected List Item(s) as Group" to the Catalog item context menu.

Process as follows:
1) User selects multiple files.
2) User uses Catalog Context menu or Drag and Drop to open files.
3) If user is attempting to open more than 25 files, get user confirmation. "You have attempted to open more than 25 files at once. This can cause severe slow down or possibly crash the machine. Do you wish to continue?" If No or Cancelled goto 8.
4) If Context Menu item is set to Individually or "Open Selected List Item(s)" is used, perform calls just as it is now, then goto 8.
5) Generate the call as: executable.exe "file1" "file2" ... "fileN"
6) If call is more than 2047 characters, report error. "Cannot execute program. The call to this program exceeds Windows' maximum length. Please try again with a smaller selection," goto 8.
7) Perform call.
8) Done.

That's it and the most complicated part about it is finding the actual limits for step 6. Microsoft lists the command line limitations as 8191 characters for XP and later, and 2047 characters prior to XP. [ http://support.microsoft.com/kb/830473 ]. But I'm not sure how you're actually making the call and what the real limitations for that method might be. When dragging and dropping within Explorer it appears that it might be 2047 characters.

Second complicated part is deciding on the number for number 3. If it's too complicated don't worry about it, there's currently no warning in Windows Explorer or XYplorer (or the number before warning is more than 400 files) so it would be just like it is now. I see no sense in making this user defined as it just gets confirmation and doesn't prevent the call from happening. If you feel this really should be user defined I think a simple "Don't show this warning again." option is enough.


Have I removed enough of the complications now?


Note: All observed behavior is on Windows XP SP2 and XYplorer 6.20.0001.

admin
Site Admin
Posts: 65456
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

TheQwerty wrote:Nope.. I'm not giving in that easy. :P

I just wanted to add some new findings to this and propose it with some changes.
Thank you for the nicely done work! You make me feel like a code slave. :wink:

Please, remind me after publication of ver 6.30 (the scriptable hotkeys edition... :) ).

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

admin wrote:Thank you for the nicely done work! You make me feel like a code slave. :wink:
Aww.. I'm sorry, I don't mean to make you feel like our coding slave. :oops: I just really would like to see this as an option and am trying to make it as easy as possible for you. (Instead of before when I was concentrating on making it as feature full as possible.)

Part of the reason I returned to this is my attempt at coding a wrapper (although I suppose it is actually more of a launcher) was failing. I'm having troubles getting it to keep up with all the calls and how quickly they were being made. Granted, if I had spent the time trying to do it in an actual programming language instead of AutoHotkey it might have worked better.
admin wrote:Please, remind me after
publication of ver 6.30 (the scriptable hotkeys edition... :) ).
:D I sure will!

Post Reply