Page 1 of 1

Fav. Toolbar -> Separate for each (...) -> %ActiSelName% NOK

Posted: 18.07.2016, 14:53
by kino
Hello,

I was willing to expand some of my favorite tools to iterate on selected items.

Unfortunately, if %ActivSel% seems to resolve correctly on full path to file at each iteration, %ActivSelName% remains as is, litterally "%ActivSelName%"

I've tested it on two files a.txt and b.txt that I select and on which I apply my favorite ad hoc tool :

Code: Select all

cmd.exe with Parameter field as :
/K echo %ActivSel% %ActivSelName%
it yields :

Code: Select all

"C:\Temp\a.txt"  %ActivSelName%
"C:\Temp\b.txt"  %ActivSelName%
whereas I would expect :

Code: Select all

"C:\Temp\a.txt"  a.txt
"C:\Temp\b.txt"  b.txt
yes ?

Thanks
(I'm using FreeCommander XE 2016 Build 725 64-bit donor)

Re: Fav. Toolbar -> Separate for each (...) -> %ActiSelName%

Posted: 20.07.2016, 20:50
by Marek
With your definition of the favorite tool I get:

Code: Select all

"C:\temp\a.txt" "C:\temp\b.txt" "a.txt" "b.txt" 
May be you can use %ActivSelAsFile%. The file content is:

Code: Select all

C:\temp\a.txt
C:\temp\b.txt

Re: Fav. Toolbar -> Separate for each (...) -> %ActiSelName%

Posted: 25.07.2016, 12:06
by kino
Hello Marek,

Thanks for answering.

I do not understand clearly your one-line output where a.txt and b.txt are interlaced (?)
I tried %ActivSelAsFile% and %ActivItem% as follows :

Code: Select all

cmd.exe with Parameter field as :
/K echo %ActivSel% %ActivSelAsFile% %ActivItem%
but it yields respectively (in two separate DOS consoles) :

Code: Select all

"C:\Temp\a.txt"  C:\Temp\APPS\FreeCommanderXE\FreeCommander21484\43C1.tmp b.txt
"C:\Temp\b.txt"  C:\Temp\APPS\FreeCommanderXE\FreeCommander21484\43C1.tmp b.txt
Thanks

Re: Fav. Toolbar -> Separate for each (...) -> %ActiSelName%

Posted: 26.07.2016, 23:12
by Marek
I do not understand clearly your one-line output where a.txt and b.txt are interlaced (?)
Suppose you have the tool MyTool.exe. The call with %ActivSelAsFile% :

Code: Select all

MyTool.exe %ActivSelAsFile%
If you use the parameter %ActivSelAsFile%, then FreeCommander create first temp file - e.g. C:\Temp\APPS\FreeCommanderXE\FreeCommander21484\43C1.tmp.
The content of the file - selected items:

Code: Select all

C:\temp\a.txt
C:\temp\b.txt
Then the %ActivSelAsFile% will be replaced with C:\Temp\APPS\FreeCommanderXE\FreeCommander21484\43C1.tmp.
Solved call:

Code: Select all

MyTool.exe C:\Temp\APPS\FreeCommanderXE\FreeCommander21484\43C1.tmp
MyTool.exe must be able to read the file with the selected items.

Re: Fav. Toolbar -> Separate for each (...) -> %ActiSelName% NOK

Posted: 18.05.2019, 16:39
by beermatt
Sorry for bringing up an old post, but it seems to be a bug that is still present, and googling brought me here so thought it would be a good place to go from.

After further experimenting I think I can see why Kino had the problem but Marek didn't. In summary it is the "seperate for each selected item" tickbox that isn't working properly, full troubleshooting steps below.

64 bit donor version 790a. All the following using the command cmd. All other options default unless specified. 2 files selected when running the tests.
  • With the parameter
    /c echo %ActivSelName% & pause
    It works
  • Same as above but tick the "Seperate for each selected item", the variable still works but it doesn't run a seperate command for each one. In other words ticking the box does nothing :-/
  • Leaving the box ticked, if I now add activesel so the parameter looks like this
    /c echo %ActivSelName% %ActivSel% & pause
    Now the tickbox appears to work as expected as it launches 2 seperate CMD windows. BUT it breaks the activeselname variable :-( and just shows the variable name instead of the filename it is referencing. This is like the problem Kino was having.
  • Keeping the same parameter (both variables), if I now remove the tick from the box "Seperate for each selected item", all the variables work again.

I think you're doing a great job with the software Marek, it's improved a lot over the years and has some great functionlity now.

Would really appreciate this fixing, being able to symbolic link items between the panes is really important for me.

Cheers, Matt

Re: Fav. Toolbar -> Separate for each (...) -> %ActiSelName% NOK

Posted: 31.12.2020, 16:09
by kino
Hello Matt, Marek,

I bump a little late on your reply Matt but it seems we are aiming the same functionality.
(the first command I'll most likely substitute cmd.exe will be ln64.exe ;-) )

Let me clarify with a case :

As I defined MyIterTool which is my iterator favorite/custom tool (Program => cmd.exe ; Parameter => /k echo %ActivSel% "%InactivDir%\%ActivSelName%") :
IterToolDefined.png
IterToolDefined.png (17.81 KiB) Viewed 23185 times

%ActiveSel% will indeed iterate each selected file in active folder (here A) in a separate cmd.exe shell...

...but target %ActiveSelName% will NOT in turn be interpolated into the current file name (here prefixed with %InactiveDir% which is expanded all right although not expected to vary) :
IterToolApplied.png

What I would expect would simply be those two cmd.exe shell yes, but with the following respective content :

Code: Select all

"D:\TEMP\A\file1.txt" "D:\TEMP\B\file1.txt"
"D:\TEMP\A\file2.txt" "D:\TEMP\B\file2.txt"
Does it make sense ?

BTW : offering a native recursive hardlink/junction tool in FC could also be a fantastic enhancement !

Thanks

K.

Re: Fav. Toolbar -> Separate for each (...) -> %ActiSelName% NOK

Posted: 26.01.2021, 15:42
by kino
Just right like in FreeCommander XE 2021 Build 841 64-bit donor
Thanks !!!

Re: Fav. Toolbar -> Separate for each (...) -> %ActiSelName% NOK

Posted: 09.04.2021, 17:04
by kino
Give a user a hand and he'll take your whole arm :

- how about providing an %ActivSelExtension% and %ActivSelPath% ?
- also, could %ActivItemNoExt% be replaced by %ActivSelNoExt% ?

...the ~Item~ vs. ~Sel~ has not much use when several items are selected right ? and when Selection is of only one item, then it's an Item you can call Sel (sounds confused without context but I'm sure one can get it from the previous posts 8) )

Thanks

846 : %ActivSel% yielding an extra pair of " (+<space>)

Posted: 07.05.2021, 14:34
by kino
Hello Marek, Dreamer, (and other resourceful FC developer heros ;),

I think we have a little bug (fortunately work-around-able) with this very functionality so I'm not opening a separate thread.
(in my setup, I have my_file1.txt in both D:\TEMP and D:\TEMP\quoted_ActiveSel_bug ; I use this dual pane tools a lot since Separate for each works well with Sels)

Basically, %ActivSel% place holder seems to generate arbitrary double-quotes characters around actual values at intrapolation-time, without "Enclose each selected item" option :
ActiveSel_extra_doublequote.png
ActiveSel_extra_doublequote.png (19.9 KiB) Viewed 16554 times
...yields :

""D:\TEMP\quoted_ActiveSel_bug\my_file1.txt" " "D:\TEMP\my_file1.txt"

whereas :

Code: Select all

/k echo "%ActivDir%\%ActivSelName%" "%InactivDir%\%ActivSelName%"
...will yield as expected :

"D:\TEMP\quoted_ActiveSel_bug\my_file1.txt" "D:\TEMP\my_file1.txt"


  • So this is my work-around for now but can you confirm "%ActivDir%\%ActivSelName%" and "%ActivSel%" are virtually the same ?
  • What about that extract " enclosing (with an extra space before ending as you can see)
Thanks

K (using Build 846 64-bit donor by now)