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

Bugs and issues - current donor version.
Post Reply
Message
Author
kino
Posts: 123
Joined: 01.04.2013, 23:24

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

#1 Post by kino » 18.07.2016, 14:53

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)

Marek
Author
Author
Posts: 3966
Joined: 10.04.2006, 09:48
Location: Germany
Contact:

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

#2 Post by Marek » 20.07.2016, 20:50

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

kino
Posts: 123
Joined: 01.04.2013, 23:24

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

#3 Post by kino » 25.07.2016, 12:06

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

Marek
Author
Author
Posts: 3966
Joined: 10.04.2006, 09:48
Location: Germany
Contact:

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

#4 Post by Marek » 26.07.2016, 23:12

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.

beermatt
Posts: 1
Joined: 18.05.2019, 16:03

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

#5 Post by beermatt » 18.05.2019, 16:39

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

kino
Posts: 123
Joined: 01.04.2013, 23:24

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

#6 Post by kino » 31.12.2020, 16:09

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 22878 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.

kino
Posts: 123
Joined: 01.04.2013, 23:24

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

#7 Post by kino » 26.01.2021, 15:42

Just right like in FreeCommander XE 2021 Build 841 64-bit donor
Thanks !!!

kino
Posts: 123
Joined: 01.04.2013, 23:24

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

#8 Post by kino » 09.04.2021, 17:04

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

kino
Posts: 123
Joined: 01.04.2013, 23:24

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

#9 Post by kino » 07.05.2021, 14:34

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 16247 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)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 9 guests