Files supplied to User Menu items

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
User avatar
SvA
Posts: 483
Joined: 29 Mar 2006, 02:41
Location: DE

Files supplied to User Menu items

Post 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.
User avatar
tukanos
Posts: 410
Joined: 21 Dec 2005, 19:14

Re: Files supplied to User Menu items

Post 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.
therube
Posts: 674
Joined: 14 Dec 2006, 06:22

Re: Files supplied to User Menu items

Post 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?
WinXP Pro SP3 or Win7 x86 | SS 2.54
User avatar
SvA
Posts: 483
Joined: 29 Mar 2006, 02:41
Location: DE

Re: Files supplied to User Menu items

Post 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.
User avatar
tukanos
Posts: 410
Joined: 21 Dec 2005, 19:14

Re: Files supplied to User Menu items

Post 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?
Post Reply