Page 1 of 1

Files supplied to User Menu items

Posted: 06 Mar 2020, 13:52
by SvA
Hi,

is there a way to launch a program from the user menu with file name from the selected file only (as it works for viewers and editors), rather than launching it for each selected file without warning? I just crashed my system by accidentaly attempting to lauch a program 4500 times by clicking on a user menu item with some files selected.

Re: Files supplied to User Menu items

Posted: 15 Mar 2020, 19:07
by tukanos
SvA wrote: 06 Mar 2020, 13:52 Hi,

is there a way to launch a program from the user menu with file name from the selected file only (as it works for viewers and editors), rather than launching it for each selected file without warning? I just crashed my system by accidentaly attempting to lauch a program 4500 times by clicking on a user menu item with some files selected.
Yes, there is a way to do it. I would use a batch file functionality. The batch file would intake the selected files via $(ListOfSelectedFullNames). Within the batch file you would then execute your program with only the first file selected. Such approach will prevent you running multiple files.

Re: Files supplied to User Menu items

Posted: 15 Mar 2020, 20:46
by therube
How?

(file names of:)
1
2
3

If I'm understanding, you have 1 2 3 highlighted, focus is on 3.

Sending the list to a batch file, %1 is 1 %* is 1 2 3.
(Changing sort order & %1 changes as expected, likewise the ordering of the items in %*.)

I'm not seeing a way to specify the particular (focused, highlighted) file?

Re: Files supplied to User Menu items

Posted: 16 Mar 2020, 20:51
by SvA
tukanos wrote: 15 Mar 2020, 19:07 The batch file would intake the selected files via $(ListOfSelectedFullNames). Within the batch file you would then execute your program with only the first file selected.
This would allow me to run the program on the first (or last) selected one. The one having the focus, might not even be selected, or might be any of the selected ones, more likely the last one, than the first one.
therube wrote: Sending the list to a batch file, %1 is 1 %* is 1 2 3.
%1 would be the file listing the files to process. You would use a For /F comand to retrieve the files. But as you pointed out, and as I stated above, there is no way to know, which one had focus, indeed, it might not even be in the list in the first place.

Re: Files supplied to User Menu items

Posted: 06 May 2020, 18:48
by tukanos
Sorry for late reply, I could login onto the forum.

Yes. I thought that is that is what you want. You want to open only the one which has the cursor on it?