Page 3 of 5

Re: <pfaitem> items are passed one-by-one?

Posted: 20 Mar 2015 16:11
by admin
Currently not. This would be MAJOR for you and me.

Re: <pfaitem> items are passed one-by-one?

Posted: 20 Mar 2015 16:19
by binocular222
SammaySarkar wrote:I think PFA can benefit from a mechanism where the PFA (script) is called only once, by some kind of notation like the existing |-prefix to disable auto-execute.
No need to change #160, just change PFA as Sammay suggest

Re: <pfaitem> items are passed one-by-one?

Posted: 20 Mar 2015 16:22
by bdeshi
Just to clarify:
I think PFA can benefit from a mechanism where the PFA (script) is called only once even when multiple items are selected, by some kind of notation like the existing |-prefix to disable auto-execute.

Re: <pfaitem> items are passed one-by-one?

Posted: 20 Mar 2015 16:29
by admin
Just to clarify: It's not PFA. It's "Open Selected Item(s)" that does the calls. No change in PFA can possibly affect this.

Re: <pfaitem> items are passed one-by-one?

Posted: 20 Mar 2015 17:36
by bdeshi
Darn. Guess we'll have to make do with giant scripts.

Re: <pfaitem> items are passed one-by-one?

Posted: 20 Mar 2015 21:20
by admin
I thought about it again. The "Open Selected Item(s)" code is almost 10 years old. It might just be about time to change it a little. I just cannot see a good reason anymore why it behaves so differently from the "Open With..." code. And worse, I just cannot see a good reason why all selected items should be opened one by one.

So, this will be changed experimentally. Let's see if it survives the weekend.

Re: <pfaitem> items are passed one-by-one?

Posted: 21 Mar 2015 17:57
by bdeshi
Thanks for the consideration, but now PFI PFA isn't available for multiple selection. Looks like a vicious circle.

Re: <pfaitem> items are passed one-by-one?

Posted: 21 Mar 2015 17:59
by admin
It's consistent now. What is not working anymore. Example?

Re: <pfaitem> items are passed one-by-one?

Posted: 21 Mar 2015 18:00
by bdeshi
Oh it's working alright, but:

single selection, ENTER: PFA assoc.
plural selection, ENTER: System assoc. (apparently). :veryconfused: minor security risk too. (why? I have a bat;cmd;vbs... pfa to open them in notepad. Now multisel+return executes them.)

Re: <pfaitem> items are passed one-by-one?

Posted: 21 Mar 2015 18:01
by admin
Give a concrete example. Under the hood this is very complex. I need exact data to respond.

Re: <pfaitem> items are passed one-by-one?

Posted: 21 Mar 2015 18:08
by bdeshi
example PFA

Code: Select all

+bat;cmd;vbs;wsh>notepad
example BATs

Code: Select all

::$str = '%COMSPEC% /K echo %0% says hello!'; writefile('a.bat', $str, r); writefile('b.bat', $str, r); writefile('c.bat', $str, r);
Now select one bat and enter. then select all bats and enter.

Re: <pfaitem> items are passed one-by-one?

Posted: 21 Mar 2015 18:54
by admin
Whoops, that was not the plan. :bug: ! Fix coming soon.

Re: <pfaitem> items are passed one-by-one?

Posted: 22 Mar 2015 07:26
by bdeshi
programs are sent selected files as space-separated args. (sidenote: if this persists, <pfaitem> needs a clone <pfaitems> to be grammatically correct :whistle: )
Scripted PFAs just seems to trigger once for the focused item.

:tup: Almost there, now all that's missing is a way to somehow toggle between current and previous behavior: exec pfa once-for-all/exec pfa one-by-one for all.

Re: <pfaitem> items are passed one-by-one?

Posted: 22 Mar 2015 09:27
by admin
SammaySarkar wrote:programs are sent selected files as space-separated args. (sidenote: if this persists, <pfaitem> needs a clone <pfaitems> to be grammatically correct :whistle: )
Scripted PFAs just seems to trigger once for the focused item.

:tup: Almost there, now all that's missing is a way to somehow toggle between current and previous behavior: exec pfa once-for-all/exec pfa one-by-one for all.
1. That's by design. <pfaitem> is the item that determines the opening application/script. The script then can handle all selected items.

2. You mean a setting in configuration? And, why would a multiple instance call of same-type items be necessary? Do you have a specific case?

Re: <pfaitem> items are passed one-by-one?

Posted: 22 Mar 2015 10:55
by bdeshi
admin wrote:1. That's by design. <pfaitem> is the item that determines the opening application/script. The script then can handle all selected items.
OK, OK. This part is what I wished for, But here's a bug: it works only as long as all selected files match the PFA.

Code: Select all

+bat>::echo <pfaitem>;
+txt>notepad
select only batch file(s) and ENTER, their pfa will run once for focused file. But add txt file to the selection and ENTER, and now the PFA script will be run multiple times for each bat.