[WFX] VirtualPanel: Temporary panel for TC

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
pvav68
Junior Member
Junior Member
Posts: 10
Joined: 2011-04-10, 09:06 UTC
Location: Slovakia

Post by *pvav68 »

MVV wrote:How many subfolders do you have in c:\TEMP? Currently you can't add directory structure using <put, it works only with single folder or filelist.
Now there are only a few subfolders but they can be added (every months).
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You should execute script >Test itself - it is test script and not command that creates it. :) It should show message box for each file in folder - look onto file names in message text (press Escape to interrupt script).
pvav68 wrote:Now there are only a few subfolders but they can be added (every months).
I think it is easier to create subfolder and add separate script file manually per month than build heavy scripts.
pvav68
Junior Member
Junior Member
Posts: 10
Joined: 2011-04-10, 09:06 UTC
Location: Slovakia

Post by *pvav68 »

MVV wrote:You should execute script >Test itself - it is test script and not command that creates it. :) It should show message box for each file in folder - look onto file names in message text (press Escape to interrupt script).
I execute command

Code: Select all

<for %%f . * {<ifok "%%f" {} {}}
from command line in virtual folder and it will show truncated names.
MVV wrote:I think it is easier to create subfolder and add separate script file manually per month than build heavy scripts.
Could I create the file list , add subfolders every month there and somehow load the file list by script?
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Hm-m, if we think a bit, we doesn't need a list file at all. :)

Create a script in root dir with name \>ClearFolder with contents (it just removes all objects except scripts from folder passed as parameter):

Code: Select all

<silent <ifexist "%1" { <cd "%1" <for /d %%f . * { <ifcond { !script @ %%~f } { <del /rfd "%%~f" } } }
Special script in root dir \>UpdateBigXLS:

Code: Select all

<silent <add "\BigXLS" <del /rfd "\BigXLS\*" <exec \>UpdateBigXLS2 "\BigXLS" "C:\TEMP"
Special intermediate script \>UpdateBigXLS2:

Code: Select all

<silent <ifdef "%2" { <ifok "%1 from %2" {} {} <cd "%1" <add >Refresh { <exec \>ClearFolder . <put /a . "%2\*.xls" <for %%%%f . * { <ifcond { !script && (size < 102400) @ %%%%~f } { <del "%%%%~f" } } } <put /ad! . "%2\*" <for /d! %%d . * { <del /d "%%d" <add "%%d" <exec \>UpdateBigXLS2 "%%~d" "%2\%%~d" } }
So you need to execute \>UpdateBigXLS and it will clear existing \BigXLS folder and then call \>UpdateBigXLS2 which will recursively recreate its subfolders with refresh scripts that use corresponding subfolder of C:\TEMP folder (it loads all dirs from physical folder to get their names and then replaces them with virtual folders). :D Each refresh script will call \>ClearFolder script and then load *.xls files from its folder and then delete all files smaller than 100k except scripts - so it won't remove itself. 8)


Note1: of course you may remove <ifok "%1 from %2" {} {} from second script file - it was used just for testing.
Note2: %%%% in script is used because we need to put %% into refresh script file (we need to double number of % characters).
Note3: %f parameter doesn't work for you just now because of bug, but %~f should work.


Changed UpdateBigXLSLoop to UpdateBigXLS2 in third code block.
Last edited by MVV on 2011-04-11, 06:14 UTC, edited 1 time in total.
pvav68
Junior Member
Junior Member
Posts: 10
Joined: 2011-04-10, 09:06 UTC
Location: Slovakia

Post by *pvav68 »

It took a little while I understood your instructions but now it works great. :D
I only have to add one "<silent" to script >UpdateBigXLS2 (before <put /a . "%2\*.xls" ...).
Thank you very much.
pvav68
Junior Member
Junior Member
Posts: 10
Joined: 2011-04-10, 09:06 UTC
Location: Slovakia

Post by *pvav68 »

Sorry MMV, but until now I found that it works only with root folder "C:\TEMP" but does not work with subfolders. Subfolders with big xls files are not added to "\BigXLS". :(
User avatar
nsp
Power Member
Power Member
Posts: 1827
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

pvav68 wrote:Sorry MMV, but until now I found that it works only with root folder "C:\TEMP" but does not work with subfolders. Subfolders with big xls files are not added to "\BigXLS". :(
You should modify script of MMV ... use

Code: Select all

....<exec \>UpdateBigXLS2...
Instead of

Code: Select all

....<exec \>UpdateBigXLSLoop...
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

pvav68 wrote:I only have to add one "<silent" to script >UpdateBigXLS2 (before <put /a . "%2\*.xls" ...).
Yes, I forgot to add it at the beginning of refresh script. :)
nsp wrote:
pvav68 wrote:Sorry MVV, but until now I found that it works only with root folder "C:\TEMP" but does not work with subfolders. Subfolders with big xls files are not added to "\BigXLS". :(
You should modify script of MVV ... use

Code: Select all

....<exec \>UpdateBigXLS2...
Instead of

Code: Select all

....<exec \>UpdateBigXLSLoop...
You're right, I've corrected my post some times during experiments and then changed second script name to UpdateBigXLS2 but forgot to change its name here. :D This script calls itself recursively so its name must be the same as specified in <exec command. BTW, it is possible to insert %0 instead of script name.
pvav68
Junior Member
Junior Member
Posts: 10
Joined: 2011-04-10, 09:06 UTC
Location: Slovakia

Post by *pvav68 »

I have changed UpdateBigXLSLoop to UpdateBigXLS2 but it did not help. :(

When I execute \>UpdateBigXLS, these windows are opened:
\BigXLS from c:\TEMP
C:\TEMP\* loaded 2 entries
Folder01 from C:\TEMP\Folder01
C:\TEMP\Folder01\* loaded 0 entries
Folder02 from C:\TEMP\Folder02
C:\TEMP\Folder02\* loaded 0 entries

Folder01 and Folder02 are subfolders in C:\TEMP and there are xls files >100KB.
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

pvav68, UpdateBigXLS only loads and creates folders, it doesn't load any files. Files will be loaded by refresh scripts that are also created by UpdateBigXLS in every added subfolder of \BigXLS.
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think it is time to release Virtual Panel 2.0.


VirtualPanel 2.0.0.1080 (changes after 1.0.0.920):
+ virtual explorer allowing to have any number of browser windows
+ virtual explorer interface tries to copy TC style
+ drag-n-drop support between virtual browser windows and external applications
+ new log event for Virtual Explorer actions
+ max state file line length now 8k characters
+ <put command may add folders from lists created via e.g. cm_SaveSelectionToFile (trailing folder slashes are now stripped)
+ <edit command now allows to edit empty targets for files
* recursive intermediate folders creation bug (after some changes in 1.0.0.920)
* <for command produced wrong names
* bits 0x01 and 0x02 of LogEnabled parameter exchanged
* log string format for FsPutFile slightly changed


VirtualPanel 2.0.0.1080 at totalcmd.net


Please note that files and folders are now dragged to external applications only with their real names and not with virtual names that you see inside of virtual folders (it is neccessary to copy files to temporary folder in order to drag them with real names, this isn't realized yet). Also drag to physical folders within browser windows is not supported yet too. Folder tree is not ready yet too (but there is reserved place for it and separator may be moved already).
pvav68
Junior Member
Junior Member
Posts: 10
Joined: 2011-04-10, 09:06 UTC
Location: Slovakia

Post by *pvav68 »

MVV wrote:pvav68, UpdateBigXLS only loads and creates folders, it doesn't load any files. Files will be loaded by refresh scripts that are also created by UpdateBigXLS in every added subfolder of \BigXLS.
But subfolders Folder01 and Folder02 are not cerated (or maybe they are immediately deleted by script).
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

If you get message "Folder01 from C:\TEMP\Folder01" script have loaded folder link and is going to replace it with virtual folder with refresh script.

I just tried it once more using all three script files in my post - all work fine, all folders are created, and when I execute refresh script, it loads *.xls files and then removes small ones.

Using last VP version you may debug script - open Virtual Explorer window using command <explore and execute UpdateBigXLS from it. Then click buttons in messages and check in TC panel what's happened (script will block virtual explorer and not TC).

You may disable auto-refresh for tests to prevent refresh scripts to be executed.
User avatar
nsp
Power Member
Power Member
Posts: 1827
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

MVV do you have a working sample of ifcond with like operator?
I have such expression in a script but it seem that nothing hapend :(

Code: Select all

<ifcond { like "*.wfx" @ %%f } { <ifok "I'm in"{} }{ <ifok "I'm out"{} }
%%f is pointing to virtual link \TC\Plugin list\virtualpanel.wfx real file is C:\tools\TC\addons\VirtualPanel\virtualpanel.wfx


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

Post by *MVV »

Heh, there is an error in function that parses argument for like - it doesn't skip ending quote so further expression processing fails.
Thanks for the report, I've fixed code, wait for next version. :)
Post Reply