TCFS2 + TCFS2Tools: Full-screen mode for TC etc

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Stefan2, white, sheep, Hacker

jmwap
Member
Member
Posts: 117
Joined: 2008-03-23, 12:40 UTC

Post by *jmwap » 2014-11-15, 17:37 UTC

Hi,

I am trying to use this to set TC always in full screen mode. So I just need a way to run the command on TC startup and all should be ok. As I am already using Autorun plugin to hide menu bar, I thought that would be the best place to run this command on TC startup, so I have this in my autorun.cfg:

ShellExec "%COMMANDER_PATH%\tools\TCFS2\TCFS2.exe" "fs2=if(hasCaption, locktc(1) + run_action(fs) + locktc(0) + show(3) + save_undo(fs_undo), show(9) + locktc(1) + run_action(fs_undo) + locktc(0)) run_item(update)"

but I get this error in startup and the command does not have any effect:
http://i.imgur.com/EmX4nJJ.png

I am doing the right thing?

thanks

User avatar
MVV
Power Member
Power Member
Posts: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2014-11-15, 17:57 UTC

mrle wrote:No, it is always expanding active panel.
Interesting. I thought cm_100Percent always sets separator position to 100%, but it really expands active panel.
jmwap wrote:I am trying to use this to set TC always in full screen mode. So I just need a way to run the command on TC startup and all should be ok. As I am already using Autorun plugin to hide menu bar, I thought that would be the best place to run this command on TC startup, so I have this in my autorun.cfg:

ShellExec "%COMMANDER_PATH%\tools\TCFS2\TCFS2.exe" "fs2=if(hasCaption, locktc(1) + run_action(fs) + locktc(0) + show(3) + save_undo(fs_undo), show(9) + locktc(1) + run_action(fs_undo) + locktc(0)) run_item(update)"

but I get this error in startup and the command does not have any effect:
http://i.imgur.com/EmX4nJJ.png

I am doing the right thing?
There are some errors:
1. Since you specify exact command instead of just item name, you should use /ef before it.
2. You must quote entire commands. But since Autorun requires quotes also, you should use different quote kinds (Autorun feature): "" for inner TCFS2 parameters and '' for entire parameter string.
3. You can't set item name in command line, so fs2= is wrong.

So your command should be rewritten as:

Code: Select all

ShellExec "%COMMANDER_PATH%\tools\TCFS2\TCFS2.exe" '/ef "if(hasCaption, locktc(1) + run_action(fs) + locktc(0) + show(3) + save_undo(fs_undo), show(9) + locktc(1) + run_action(fs_undo) + locktc(0)) run_item(update)"'
However, since you call this command at TC start, you may be sure that TC is not in a full-screen mode before it. So you don't need a condition, just direct commands, e.g.:

Code: Select all

ShellExec "%COMMANDER_PATH%\tools\TCFS2\TCFS2.exe" '/ef "eval(show(9) + locktc(1) + run_action(fs) + locktc(0) + run_item(update))"'

jmwap
Member
Member
Posts: 117
Joined: 2008-03-23, 12:40 UTC

Post by *jmwap » 2014-11-15, 22:28 UTC

working perfectly, this is excellent, thanks so much MVV

sticazzi
Junior Member
Junior Member
Posts: 39
Joined: 2007-09-09, 14:56 UTC

Post by *sticazzi » 2014-11-18, 15:06 UTC

Hi.

I would like to hide TC's windows title (mainly when I use TC on my 12" laptop) with a TC menu entry or button using TCFS2:

Is it possible with TCFS2 only or I must load TCFS2Tools too?

Honestly I dont know which command to use (I read readme file and TCFS2.ini in En folder). I'm blocked here:


Command: %Commander_Path%\tools\TCFS2\TCFS2.exe
Parameters: /ei <missingcommand>


Anyone could give me some hint about this?

Many thanks.

User avatar
MVV
Power Member
Power Member
Posts: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2014-11-18, 18:42 UTC

Your <missingcommand> is c0 which hides window title (= caption). TCFS2Tools is not required for it. Don't forget to copy/move TCFS2.ini from EN folder to main TCFS2 folder.

sticazzi
Junior Member
Junior Member
Posts: 39
Joined: 2007-09-09, 14:56 UTC

Post by *sticazzi » 2014-11-18, 19:04 UTC

MVV wrote:Your <missingcommand> is c0 which hides window title (= caption). TCFS2Tools is not required for it. Don't forget to copy/move TCFS2.ini from EN folder to main TCFS2 folder.
thanks a lot MVV :wink:

User avatar
MVV
Power Member
Power Member
Posts: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2015-06-03, 14:53 UTC

Updated version released. :)

TCFS2 2.2.1.476:
+ case sensitive and insensitive INI string comparisons
+ send function is now able to send any virtual key (e.g. Win key as VK_91)
+ send function supports zero handle value (disables window activity checks)
* fixed string to number conversion when reading from INI
* items return 0 if no branches were executed
* ignoring double quotes bug

User avatar
xmeron
Junior Member
Junior Member
Posts: 90
Joined: 2009-06-17, 19:43 UTC

Post by *xmeron » 2015-10-31, 02:29 UTC

Below format and all other variable formats can't work, checked the newest help again, seems tcfs2 don't support this type till now? Or that is just not the right format?
What I need is repeating the group key press {insert}{down}{down}{down} 20 times, thanks :D :
send(`{insert down down down 20}`)

User avatar
MVV
Power Member
Power Member
Posts: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2015-10-31, 12:03 UTC

Sorry, you can't repeat a sequence of multiple keys, only one key may be in braces. Perhaps you could use a loop that calls send(`{insert}{down 3}`) twenty times.

giulia
Member
Member
Posts: 154
Joined: 2013-09-14, 05:33 UTC

Post by *giulia » 2015-11-03, 15:41 UTC

MVV wrote:Sorry, you can't repeat a sequence of multiple keys, only one key may be in braces. Perhaps you could use a loop that calls send(`{insert}{down 3}`) twenty times.
wow
great plugins
discovered 5 min ago :(
Total Commander 's lover

zhxeeaa
Junior Member
Junior Member
Posts: 20
Joined: 2016-12-10, 06:21 UTC

Post by *zhxeeaa » 2016-12-10, 07:48 UTC

Hi MVV,are you still here?
Thanks for this powerful and useful tool!
I already use it to hide TC's menu bar and succeed,
but I meet a problem after press TC's ftp panel "FTPdiconnect",include "webdav" plugins
there will left a blank,when I change any view about TC,It resume normal.
so I creat a new button binding this actions:
[em_DisconnectFTP]
cmd=%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe
param= /ef tcm(552) tcm(102) tcm(101) tcm(3007)
to disconnect FTP、WebDav on buttonbar ,I can not find a way to replace the "disconnect" on FTP panel.

by the way,I want make a commander to realize a sequence of comamnds with TCFS2,
when I select a folder,press the button,It will do this:
1.rename the folder to It's origin name+date i.e A to A_20161210;
2.move all files and sub-folders in this folder out to current place;

now I make this
[em_RenameCopy]
cmd=%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe
param= /ef "tcm(1007) send(`[yMD]` `{ENTER}`) delay(100) tem(`em_CopyToHere`)"

[em_CopyToHere]
cmd=NirCMD.exe execmd Batch\CopyToHere.bat
param=%P%N "%P"
path=%COMMANDER_PATH%\TOOLS

CopyToHere.bat:
xcopy %1 %2 /e /h /k /y

two problem:
1.I don't know how to get/fix the name of folder with the date,
2.and I don't want use "xcopy" to move files and directorys because It's too slow,
I want to use "move" but It can not support this same parameters,I want use "tcm(1005)"but don't know how to

If you have any more smoothly method to do please tell me,thanks!

User avatar
MVV
Power Member
Power Member
Posts: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-12-10, 13:41 UTC

Yes, I'm still there. :)
after press TC's ftp panel "FTPdiconnect",include "webdav" plugins
there will left a blank,when I change any view about TC,It resume normal
So, disconnect button on FTP panel and cm_FtpDisconnect work differently? Could you post a screenshot with that blank (and I don't use webdav plugin).
two problem:
Well, it may be easier to rename and move using the same batch file. This is how you can get folder date:

Code: Select all

@echo off
set ITEMPATH=%~dpnx1
if "%ITEMPATH:~-1%"=="\" set ITEMPATH=%ITEMPATH:~0,-1%

set ITEMDATESTR=
for /f "usebackq delims= " %%t in (`dir "%ITEMPATH%?" 2^>nul ^| find "<"`) do set ITEMDATESTR=%%t
if "%ITEMDATESTR%"=="" for /f "usebackq delims= " %%t in (`dir /a "%ITEMPATH%?" 2^>nul ^| find "<"`) do set ITEMDATESTR=%%t

echo ITEMDATESTR: %ITEMDATESTR%
set ITEMDATE=%ITEMDATESTR:~6,4%%ITEMDATESTR:~3,2%%ITEMDATESTR:~0,2%
echo ITEMDATE: %ITEMDATE%
(first, we cut trailing slash and run dir command to get folder timestamp, if folder is hidden, we need dir /ah; then we copy timestamp parts as we need: in my locale ITEMDATESTR looks like 10.12.2016 so I need to copy 4 characters starting from 6th, two starting from 3rd and two starting from beginning, so finally I get 20161210)

Next you need to move its contents to another location... You can just use move for every folder item, it will move subfolders too but it will only work within same volume:

Code: Select all

set TARGETPATH=%~dpnx2
for /f "usebackq delims=" %%f in (`dir /b "%ITEMPATH%"`) do move "%%f" "%TARGETPATH%\"
for /f "usebackq delims=" %%f in (`dir /b /ah "%ITEMPATH%"`) do move "%%f" "%TARGETPATH%\"
But if you move across volumes, you need xcopy and rd instead.

And finally you need to rename old folder:

Code: Select all

move "%ITEMPATH%" "%ITEMPATH%_%ITEMDATE%"
Same thing may be done with much simpler PowerShell script:

Code: Select all

$folder = gi $args[0];
$targetPath = $args[1];
dir $folder -Force | move -Force -Destination $targetPath;
$timestamp = $folder.LastWriteTime.ToString('yyyyMMdd');
ren $folder "$($folder.Name)_$timestamp";
You can run it e.g. like this:

Code: Select all

Command: powershell.exe
Parameters: -ExecutionPolicy Bypass "X:\Path\To\RenameMoveScript.ps1" %P%N %P
But it also requires additional actions if you move across volumes.

zhxeeaa
Junior Member
Junior Member
Posts: 20
Joined: 2016-12-10, 06:21 UTC

Post by *zhxeeaa » 2016-12-11, 05:25 UTC

Wo your quote is so fast,I'm very excited about it.:D
So, disconnect button on FTP panel and cm_FtpDisconnect work differently? Could you post a screenshot with that blank (and I don't use webdav plugin).
Just like this——(I have no permision to post URL here still,so please attension there a space in "xxx.c om" need to remove it manually) :?
before:
thumbsnap.c om/s/TkuHCo9p.png
after:
thumbsnap.c om/s/6lr9SXAp.png

Next you need to move its contents to another location... You can just use move for every folder item, it will move subfolders too but it will only work within

same volume:

Code: Select all

set TARGETPATH=%~dpnx2
for /f "usebackq delims=" %%f in (`dir /b "%ITEMPATH%"`) do move "%%f" "%TARGETPATH%\"
for /f "usebackq delims=" %%f in (`dir /b /ah "%ITEMPATH%"`) do move "%%f" "%TARGETPATH%\"
But if you move across volumes, you need xcopy and rd instead.
It's do nothing on my PC but the rename valid,I don't know why and I click "move /?" in CMD window,there be normal respones.(Windows 7 utimate)
And finally you need to rename old folder:

Code: Select all

move "%ITEMPATH%" "%ITEMPATH%_%ITEMDATE%"
I wanna rename the father-folder first to avoid replaced when moving the same name sub-folder out.
and I need two divided functions to apply "autorename" not only folder but also file(such as *.xls,*.xlsx,*.doc……)
e.g.
1
|—A
| |—A
| |—a1
| |—a2.*
Entering floder "1",select the folder "A" and press a customized button,It will do:
1.Rename father-folder "A" to "A_161211" ;

Code: Select all

@echo off
set ITEMPATH=%~dpnx1
if "%ITEMPATH:~-1%"=="\" set ITEMPATH=%ITEMPATH:~0,-1%

set ITEMDATESTR=
for /f "usebackq delims= " %%t in (`dir "%ITEMPATH%?" 2^>nul ^| find "<"`) do set ITEMDATESTR=%%t
if "%ITEMDATESTR%"=="" for /f "usebackq delims= " %%t in (`dir /a "%ITEMPATH%?" 2^>nul ^| find "<"`) do set ITEMDATESTR=%%t

echo ITEMDATESTR: %ITEMDATESTR%
set ITEMDATE=%ITEMDATESTR:~0,2%%ITEMDATESTR:~3,2%%ITEMDATESTR:~6,2%
echo ITEMDATE: %ITEMDATE%

move "%ITEMPATH%" "%ITEMPATH%_%ITEMDATE%"
(Done well for folder but not file)
If I wanna use tcm(1007) to autorename selected file or folder like this:
cmd=%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe
param= /ef "tcm(1007) send(`%oldname%_%ymd%` `{ENTER}`)
would you please teaching me how to do this?

2.move sub-folder "A"、"a1" and file "a2.*"……all contents in father-folder "A"(now is "A_161211") to folder "1",same level with "A_161211",no need enter "A_161211",and no need move to other volume too.

Code: Select all

@echo off
set ITEMPATH=%~dpnx1
if "%ITEMPATH:~-1%"=="\" set ITEMPATH=%ITEMPATH:~0,-1%

set TARGETPATH=%~dpnx2
for /f "usebackq delims=" %%f in (`dir /b "%ITEMPATH%"`) do move "%%f" "%TARGETPATH%\"
for /f "usebackq delims=" %%f in (`dir /b /ah "%ITEMPATH%"`) do move "%%f" "%TARGETPATH%\"
(invalid)
Same thing may be done with much simpler PowerShell script:
Sorry I just want to make some "simple" actions with already exsiting and requently used programs,so just only take a protable TC,no need to install etc.,I can use this all at anytime and any PC :lol: thanks a lot~

User avatar
MVV
Power Member
Power Member
Posts: 8286
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-12-11, 17:28 UTC

zhxeeaa wrote:Wo your quote is so fast,I'm very excited about it.:D
You're lucky. :D
zhxeeaa wrote:Just like this——(I have no permision to post URL here still,so please attension there a space in "xxx.c om" need to remove it manually) :?
before:
thumbsnap.c om/s/TkuHCo9p.png
after:
thumbsnap.c om/s/6lr9SXAp.png
Well, if you can reproduce this behaviour w/o TCFS2 by executing FTP disconnect (552) command from menu or by Ctrl+Shift+F, or by executing cm_FtpDisconnect from TC command line, you should report it as a TC bug (but you should check it with latest RC version before reporting in such case).
I wanna rename the father-folder first to avoid replaced when moving the same name sub-folder out.
OK, that makes sense, you can rename it first.
If I wanna use tcm(1007) to autorename selected file or folder like this:
You can't insert timestamp directly from TC, you need some batch/script, but if you use batch/script, it is much easier to rename from it.
It's do nothing on my PC but the rename valid,I don't know why
2.move sub-folder "A"、"a1" and file "a2.*"……all contents in father-folder "A"(now is "A_161211") to folder "1",same level with "A_161211",no need enter "A_161211",and no need move to other volume too.
I've forgotten to add paths for items to be moved. This should work for both folders/files except hidden ones (move command can't move hidden items).

Code: Select all

@echo off
set ITEMPATH=%~dpnx1
if "%ITEMPATH:~-1%"=="" set ITEMPATH=%ITEMPATH:~0,-1%

set ITEMDATESTR=
for /f "usebackq delims= " %%t in (`dir "%ITEMPATH%?" 2^>nul ^| find "<"`) do set ITEMDATESTR=%%t
if "%ITEMDATESTR%"=="" for /f "usebackq delims= " %%t in (`dir /a "%ITEMPATH%?" 2^>nul ^| find "<"`) do set ITEMDATESTR=%%t

set ITEMDATE=%ITEMDATESTR:~0,2%%ITEMDATESTR:~3,2%%ITEMDATESTR:~6,2%
set ITEMPATH_RENAMED=%ITEMPATH%_%ITEMDATE%
echo Renaming folder to "%ITEMPATH_RENAMED%"...
move "%ITEMPATH%" "%ITEMPATH_RENAMED%"

set TARGETPATH=%~dpnx2
for /f "usebackq delims=" %%f in (`dir /b "%ITEMPATH_RENAMED%"`) do move "%ITEMPATH_RENAMED%\%%f" "%TARGETPATH%"
for /f "usebackq delims=" %%f in (`dir /b /ah "%ITEMPATH_RENAMED%"`) do move "%ITEMPATH_RENAMED%\%%f" "%TARGETPATH%"
Sorry I just want to make some "simple" actions with already exsiting and requently used programs,so just only take a protable TC,no need to install etc.,I can use this all at anytime and any PC
PowerShell is a system application which is available by default on any Windows 7+ installation, so it is absolutely portable. If you don't have to use Windows XP of course. :)
This should move contents after renaming (and it moves hidden items because of -Force switch):

Code: Select all

$folder = gi $args[0];
$targetPath = $args[1];
$timestamp = $folder.LastWriteTime.ToString('yyyyMMdd');
$renamedFolder = "$($folder.Parent.FullName)\$($folder.Name)_$timestamp";
move $folder $renamedFolder;
dir $renamedFolder -Force | move -Force -Destination $targetPath;

zhxeeaa
Junior Member
Junior Member
Posts: 20
Joined: 2016-12-10, 06:21 UTC

Post by *zhxeeaa » 2016-12-22, 10:56 UTC

Thanks for your help :)
It's very useful to me.

Post Reply