1
Support and Feedback / Re: How to change the tab color?
« on: February 27, 2023, 12:13:47 »
Core Settings > Colors
2023-01-01
MultiCommander v12.8 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.
@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
}
}
@var $sel_files = GetSourceSelectedPaths();
@var $sel_count = arrayCount($sel_files);
@var $find_text = "aaa\\nbbb";
@var $repl_text = "xxx\\nyyy";
@var $n;
for($n = 0; $n < $sel_count; $n++)
{
@var $file = $sel_files[$n];
# @var $new_file = PathGetPathPart($file) ^ PathGetNamePart($file, 1) + "_new" + PathGetFileExtPart($file);
@var $new_file = "*_new.*";
MC.Utils.FindAndReplace MODE="Many" FIND={$find_text} REPLACEWITH={$repl_text} FILE="{$file}" TARGET="{$new_file}" SILENT REPLACEALL OVERWRITE
}
MC.Utils.FindAndReplace REPLACEALL MODE="Many" FIND="fff\nddd" REPLACEWITH="zzz\naaa" FILE="d:\\temp\\1.txt" TARGET="*_new.*" SILENT OVERWRITE
How do you cancel dragging?
Could you add a screenshot with the place where I need to add it, please?
Additionally, what's the difference between Remove link target and link to Remove link, not target?