76
Support and Feedback / Re: My standard toolbar is incomplete
« on: November 19, 2023, 20:13:25 »
Menu > View > Toolbars > File Commands ?
MultiCommander v14.2 is released!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Sorry,I typed the wrong option. You should check “Configuration - Explorer Panel Settings - Display - Selection and Checking of items - Unselect other files and folders when single selecting”
@var $shortcut_name = AskText( "Enter shortcut name:", "", 0 );
if ( 0 == StrLen( $shortcut_name ) )
{
return;
}
//@var $url_name = GetClipboardText();
@var $url_name = "";
$url_name = AskText( "Enter shortcut URL:", $url_name, 0 );
if ( 0 == StrLen( $url_name ) )
{
return;
}
$shortcut_name = GetSourcePath() ^ $shortcut_name + ".url";
$url_name = "URL=" + $url_name;
@var $content[];
arrayAdd( $content, "[InternetShortcut]" );
arrayAdd( $content, $url_name );
@var $result = SaveArray( $shortcut_name, $content, 0, 1 );
if ( 0 == $result )
{
MessageBox( "Error", "URL shortcut was not created!", 0 );
}
@var $src_path = GetSourcePath();
@var $names = GetSourceItems();
@var $count = arrayCount( $names );
@var $i;
for( $i = 0; $i < $count; $i++ )
{
@var $file = $src_path ^ $names[ $i ];
@var $result = FileExists( $file );
if ( 1 == $result )
{
MC.Explorer.SetItemFocus ITEM="{$names[ $i ]}"
break;
}
}
I've created a password-protected *.7z archive via 7z File Manager (official GUI).
When I enter such archive and try to copy some file via F5, password dialog appears which shows entered symbols instead of "*"
@var $path = GetSourceFocusPath();
@var $new_name = GetSourcePath() ^ PathGetNamePart( $path, 1 ) + ".webp";
MC.Run CMD="D:\ImageMagick\convert.exe" ARG="${focusfilepath} ${new_name}";
@var $now = GetTime();
@var $date = FormatDate("dd-MM-yy" , $now);
@var $path = GetSourcePath() ^ $date;
MakeDir($path);
@var $now = GetTime();
@var $options[];
arrayAdd( $options, FormatDate("dd-MM-yy" , $now) );
arrayAdd( $options, FormatDate("dd-MM-yyyy" , $now) );
arrayAdd( $options, FormatDate("yyyy_MM_dd" , $now) );
arrayAdd( $options, FormatDate("ddd MMM yyyy" , $now) );
@var $o = AskOption( "Make new dir: select date format", $options, 0 );
if( $o > -1 )
{
@var $path = GetSourcePath() ^ $options[$o];
MakeDir($path);
}
What do I have to put in "Find" and "Replase with" so that everything disappears behind the first "["?
Is Option 2 really needed ? if you enter many delimiters . dont you always want it to split at the position where any of the delimiters are found ? (option 1 ?)
1)
When you have selected several files, and using the windows hotkeys, pressing f2 should open the multirenamer windows, with those files already loaded.
So you mean if you set target name like CopyFile ("C:\NewFile.txt" , C:\MyFile.txt" , "NODIALOG, OVERWRITE_ALL" );
It does not work ?
# Error "Source and Target file are the same. Cannot copy a file to itself"
# (err.png)
@var $res = CopyFile("d:\\temp\\abc.txt", "d:\\temp\\1.txt", "NODIALOG")
# $res = 1, but file is not copied
$res = CopyFile("d:\temp\abc.txt", "d:\temp\1.txt", "NODIALOG")
# Shows copy dialog with wrong destination path (err2.png),
# but produce no error, file is not copied
$res = CopyFile("d:\temp\abc.txt", "d:\temp\1.txt")
@var $str = "123,|456;|,789";
@var $arr = StrSplit($str, ";|,");
# parse csv S&R file
function ParseCSV($file, $separators, $quote_chars)
{
if ( !(StrLen($separators) == 1) )
{
$separators = ",";
}
if ( StrLen($quote_chars) == 0 )
{
$quote_chars = "\"";
}
@var $reg_ex = "^([" + $quote_chars + "])(.*)\\1$";
@var $lines = LoadArray($file);
@var $lines_cnt = arrayCount($lines);
# single-string multiline S&R patterns
# $pattern[0] - search pattern, $pattern[1] - replace pattern
@var $pattern[2] = {"", ""};
@var $i;
for ($i = 0; $i < $lines_cnt; $i++)
{
# $pair[0] - search pattern, $pair[1] - replace pattern
@var $pair = StrSplit($lines[$i], $separators);
# invalid line
if ( !(arrayCount($pair) == 2) )
{
continue;
}
# append unquoted patterns
$pattern[0] = $pattern[0] + StrRegExpReplace( $pair[0], $reg_ex, "$2" ) + "\n";
$pattern[1] = $pattern[1] + StrRegExpReplace( $pair[1], $reg_ex, "$2" ) + "\n";
}
return $pattern;
}
###
@var $sar_file = GetTargetFocusPath();
@var $sar_pattern = ParseCSV($sar_file, ";", "\"`");
if ( ( StrLen($sar_pattern[0]) * StrLen($sar_pattern[1]) ) > 0 )
{
@var $sel_files = GetSourceSelectedPaths();
@var $sel_count = arrayCount($sel_files);
@var $n;
for($n = 0; $n < $sel_count; $n++)
{
@var $file = $sel_files[$n];
@var $new_file = "*_new.*";
MC.Utils.FindAndReplace MODE="Many" FIND={$sar_pattern[0]} REPLACEWITH={$sar_pattern[1]} FILE="{$file}" TARGET="{$new_file}" SILENT REPLACEALL OVERWRITE
}
}