This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Search result and TC parameters

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed Printable version
View previous topic :: View next topic  
Author Message
rust
Junior Member
Junior Member


Joined: 20 Dec 2013
Posts: 13

PostPosted: Sun Jan 19, 2014 9:47 pm    Post subject: Search result and TC parameters Reply with quote

This isn't really bug, I'd say it's TC specificity. In search result panel %P, %T return empty string, %N, %M return path\name.ext, %O returns path\name w/o ext.
Using MVV's TCFS2 tool, I make selection by partial name. When the cursor located on tc850x32_b12.exe file, I call selection dialog, then put %O, then send backspace twice, send star. All "tc850x32_b*" are selected.
If it isn't so hard, could you to fix %parameters work, please.
Back to top
View user's profile Send private message
rust
Junior Member
Junior Member


Joined: 20 Dec 2013
Posts: 13

PostPosted: Sun Jan 19, 2014 10:09 pm    Post subject: Reply with quote

"I do selection by partial name", of course Sad
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7808
Location: Russian Federation

PostPosted: Sun Jan 19, 2014 11:57 pm    Post subject: Reply with quote

I think %P doesn't work in search results panel because there is no single path there.

I don't understand where do you use %O... is it in button parameters? What does your button do in general?

BTW you may edit your posts. Wink
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
rust
Junior Member
Junior Member


Joined: 20 Dec 2013
Posts: 13

PostPosted: Mon Jan 20, 2014 2:08 am    Post subject: Reply with quote

MVV, the idea is to select files like file01, file02... where differ last charachters (usually counter)
I use em_command, it calls selection dialog, inserts filename under cursor and removes last 2 characters.
Code:
[em_selByPartName]
button=
param=/ef "tcm(3312,1) send(`{DQ}%O{BS 2}*{DQ}`)"
cmd=%COMMANDER_PATH%\addons\tcfs2.exe

Wow, there is Edit button, now I see it, thanks
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7808
Location: Russian Federation

PostPosted: Mon Jan 20, 2014 3:37 am    Post subject: Reply with quote

OK, I see. You can use batch file between TC and TCFS2 that will extract filename from path, e.g. selbypartname.bat:
Code:
@echo off
start "" "%COMMANDER_PATH%\addons\tcfs2.exe" /ef "tcm(3312,1) send(`{DQ}%~n1{BS 2}*{DQ}`)"

Add it to buttonbar, set parameter to %P%N and enable Minimized option to hide black window.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
rust
Junior Member
Junior Member


Joined: 20 Dec 2013
Posts: 13

PostPosted: Mon Jan 20, 2014 4:17 am    Post subject: Reply with quote

Thanks, it works except names with spaces
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7808
Location: Russian Federation

PostPosted: Mon Jan 20, 2014 4:58 am    Post subject: Reply with quote

It works for all filenames for me. However dialog may appear after send function is executed so no keypresses will be sent to it, also dialog must not lose focus until keypresses are sent. You should use delay or wait_for and specify window class for send.

So, this one works for me:
Code:
start "" "%COMMANDER_PATH%\addons\tcfs2.exe" /ef "tcm(3312,1) eval(delay(100)+wait_for(findwnd(`TCOMBOINPUT`), 5)) send(`{DQ}%~n1{BS 2}*{DQ}{ENTER}`, findwnd(`TCOMBOINPUT`))"

_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 33769
Location: Switzerland

PostPosted: Mon Jan 20, 2014 9:46 am    Post subject: Reply with quote

The behaviour of %P and %N is intentional: If the user specified only %N, it wouldn't work in the search result. Therefore %N has to contain the full path. If he specified %P%N, it wouldn't work if %P also contained the path, so %P must be empty. Similar problems when user uses %O.otherext or %P%O.otherext.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DrShark
Power Member
Power Member


Joined: 03 Nov 2006
Posts: 802
Location: Kyiv, 68/262

PostPosted: Thu Jun 22, 2017 12:17 pm    Post subject: Reply with quote

My often use case is to open in the new tab the folder of the file under cursor in the panel with the search results, so it would be nice if at least a single %P would work in search results.
_________________
Android 4.0.4 w/o root, Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group