Multi Commander > Beta Releases
Multi Commander 6.5 BETA
Ulfhednar:
Thanks for the reply Mathias.
I only needed to Unhceck "Refresh tabs when application focus is returned to MC" to match your suggestions.
So far it has not randomly jumped again today.
It started jumping about in folders containing mixed files & folders after I posted, the example I gave originally was files only in a nested folder.
This reminded me of something that had happened a few builds back that had been fixed.
This may be unrelated to the build but this is very noticeable also (it came & went a few builds back if you recall) - why would a script slow down folder navigation (hold focus) & can I do anything about it?
eg I have a script to rename & move a file.----
If I simply move the file I can immediately navigate away from the folder whilst the process occurs.
Today I noticed that I must now wait until the copy/move op is completely finished before I can navigate away up the tree.
Is it the mix of MC custom command & script perhaps?
This is my button script:-
--- Code: ---Log( 1, 10, "Renaming files to %%parent_folder_name%%[_N].*" );
@var $src_path = GetSourcePath();
@var $arr = PathGetParts( $src_path );
@var $name = $arr[0];
@var $prefix = StrReplace( PathGetPathPart( $src_path, 1 ), $name, "" );
@var $n = StrRFind( $prefix, "\\" );
if ( $n > 0 )
{
$prefix = StrSub( $prefix, $n + 1, StrLen( $prefix ) - $n - 1 );
@var $i;
@var $s;
@var $file;
@var $files;
$arr = GetSourceSelectedPaths();
for ( $i = 0; $i < arrayCount( $arr ); $i++ )
{
$file = $arr[$i];
$s = PathGetFileExtPart( $file );
$name = $prefix + "*" + $s;
$files = FindFiles( $src_path + $name );
$n = arrayCount( $files );
if ( $n == 0 )
{
$s = "";
}
else
{
if ( $n == 1 )
{
$s = $files[0];
RenameFile( $s, StrReplace( $name, "*", "_0" ), "RENAME_RO" );
}
$s = "_" + numtostr( $n );
}
RenameFile( $file, StrReplace( $name, "*", $s ), "RENAME_RO" );
}
}
else
{
Log( 1, 10, "It seems parent folder is root. Renaming impossible." );
}
// move
@var $arr1 = GetSourceSelectedPaths();
@var $items1 = arrayCount($arr1);
@var $MoveNameFullPath;
@var $targetPath;
@var $sourceFile;
@var $n1 = 0;
for( $n1 = 0; $n1 < $items1; $n1++ )
{
$MoveNameFullPath = $arr1[ $n1 ];
$targetPath = GetTargetPath();
$sourceFile = $MoveNameFullPath;
MoveFile( $targetPath, $sourceFile, "NODIALOG");
}
--- End code ---
Mathias (Author):
--- Quote from: Ulfhednar on December 19, 2016, 16:04:38 ---This may be unrelated to the build but this is very noticeable also (it came & went a few builds back if you recall) - why would a script slow down folder navigation (hold focus) & can I do anything about it?
eg I have a script to rename & move a file.----
If I simply move the file I can immediately navigate away from the folder whilst the process occurs.
Today I noticed that I must now wait until the copy/move op is completely finished before I can navigate away up the tree.
Is it the mix of MC custom command & script perhaps?
This is my button script:-
--- Code: ---Log( 1, 10, "Renaming files to %%parent_folder_name%%[_N].*" );
@var $src_path = GetSourcePath();
@var $arr = PathGetParts( $src_path );
@var $name = $arr[0];
@var $prefix = StrReplace( PathGetPathPart( $src_path, 1 ), $name, "" );
@var $n = StrRFind( $prefix, "\\" );
if ( $n > 0 )
{
$prefix = StrSub( $prefix, $n + 1, StrLen( $prefix ) - $n - 1 );
@var $i;
@var $s;
@var $file;
@var $files;
$arr = GetSourceSelectedPaths();
for ( $i = 0; $i < arrayCount( $arr ); $i++ )
{
$file = $arr[$i];
$s = PathGetFileExtPart( $file );
$name = $prefix + "*" + $s;
$files = FindFiles( $src_path + $name );
$n = arrayCount( $files );
if ( $n == 0 )
{
$s = "";
}
else
{
if ( $n == 1 )
{
$s = $files[0];
RenameFile( $s, StrReplace( $name, "*", "_0" ), "RENAME_RO" );
}
$s = "_" + numtostr( $n );
}
RenameFile( $file, StrReplace( $name, "*", $s ), "RENAME_RO" );
}
}
else
{
Log( 1, 10, "It seems parent folder is root. Renaming impossible." );
}
// move
@var $arr1 = GetSourceSelectedPaths();
@var $items1 = arrayCount($arr1);
@var $MoveNameFullPath;
@var $targetPath;
@var $sourceFile;
@var $n1 = 0;
for( $n1 = 0; $n1 < $items1; $n1++ )
{
$MoveNameFullPath = $arr1[ $n1 ];
$targetPath = GetTargetPath();
$sourceFile = $MoveNameFullPath;
MoveFile( $targetPath, $sourceFile, "NODIALOG");
}
--- End code ---
--- End quote ---
The scripts are run in the same thread so the UI. so the control is not returned back to the UI until the script have finished.
Running the script in the background is possible. But it is not officially supported since you really need to understand threads and the issues with them and race condition.
For example If the script you have above was run in the background. what would happen if you during the execution of the script moved focus to another tab or location ?
The GetTargetPath() would all of a sudden would to start to return a different path.
Ulfhednar:
--- Quote from: Mathias (Author) on December 19, 2016, 21:47:28 ---The scripts are run in the same thread so the UI. so the control is not returned back to the UI until the script have finished.
Running the script in the background is possible. But it is not officially supported since you really need to understand threads and the issues with them and race condition.
For example If the script you have above was run in the background. what would happen if you during the execution of the script moved focus to another tab or location ?
The GetTargetPath() would all of a sudden would to start to return a different path.
--- End quote ---
Ahaa. That makes sense. Thanks for the info Mathias :)
Ulfhednar:
Strange filter behavior
(Using b2303 w7x64)
I set up an advanced filter for folders >1mb made within the last 2 days, (In the file matching tab I have only the default entry of *). See pic.
If folders have been size calculated the filter works but when I click 'show all' or enter *.* manually, I get nothing displayed in the pane. ???
Using F5 or the 'refresh' icon does nothing. I can only re-display the items in the pane by navigating away & then back.
Broken?
Navigation
[0] Message Index
[*] Previous page
Go to full version