Multi Commander > Script

Select / deselect switch fault?

(1/5) > >>

Ulfhednar:
I'm trying to do a MS that will

* select any zips
* extract (& overwrite if req'd)
* deselect
* run a new function - eg new selection, rename & move on the extracted fileHowever the select / deselect command seems to malfunction.
Using the debugger to step through, this works:-


--- Code: ---MC.Explorer.Select FILTER="*.zip"
MC.Explorer.Deselect FILTER="*.zip"
--- End code ---

MC selects then deselects the zip(s)

However when I add an Unpack command:-


--- Code: ---MC.Explorer.Select FILTER="*.zip"
MC.Filesystem.Unpack TARGET=${sourcepath} FILTER="*.*"
MC.Explorer.Deselect FILTER="*.zip"
--- End code ---

MC reselects the zip at the end of the unpack routine. 
If it is a multi-part zip, MC will only select part 1, not the whole *.zip set at the end of the routine.

This means my next script commands do not get processed.
I also tried using MC.Explorer.Selection.Unselect & MC.Explorer.SetItemFocus but couldn't get away from the initial zip selection.

Also wondering about an 'overwrite' switch for the unpacker.  Can't find anything on MC.Filesystem.Unpack in the docs.

Mathias (Author):
MC.Filesystem.Unpack do not call the Menu option.. it is calling the under laying code for unpack.

You need to specify that file to unpack. It will not take all files that exists


--- Code: ---MC.Filesystem.Unpack FILE="C:\my.zip" TARGET="C:\UnPacked\"
--- End code ---

Mathias (Author):
If you want to run an internal command, Like the one that are menu option and such.. then you need to call MC.RunCmd Cmd="",
use the Customized keyboard dialog to find the internal command id. Looks like "Core.1234" and such..

Ulfhednar:
Thanks Mathias.

Unfortunately I am most concerned about the deselection process.
MC leaves the hi-light/selection on zip#1.
I have discovered that if the .. at the top of the folder is hi-lited after each operation the script will run as I intended.  (I need to manually confirm overwrite etc during the process of course).

Can I make the selection move to the .. after a process?

if I have -

--- Code: ---..
xyz.zip
--- End code ---
-> extract *.*

I then get -

--- Code: ---..
1.jpg
2.txt
3.exe
xyz.zip

--- End code ---

& xyz.zip is still selected after the unpack

So with

--- Code: ---MC.Explorer.Select FILTER="*.zip"
MC.Filesystem.Unpack TARGET=${sourcepath} FILTER="*.*"
MC.Explorer.Deselect FILTER="*.*"
MC.Explorer.Select FILTER="*.txt"
// ...This would then be followed by a rename function.

--- End code ---

Sometimes only .zip is renamed or both txt & zip are renamed depending on how the selection bar behaves.  ??? 
Pic 3 was only achieved by selecting .. first, 1 & 2 are before & after the above script was run with no file selected.

If I do this process in steps & select the .. between the steps it will function correctly.  So I'd like to force deselect or selection of .. with hi-lite bar in active pane between each operation. 
Is that possible?

Ulfhednar:
I find I need the script command for what happens when pressing the <home> key. 
Perhaps - go to top ExplorerPanel.41075
Will see if I can make it work later.

Navigation

[0] Message Index

[#] Next page

Go to full version