76
Support and Feedback / Re: MultiCommander v8.9 BETA
« on: June 05, 2019, 12:57:10 »
pncdaspropagandas I can see that is what it should do, so I am wondering how it avoids doing it & selects a pdf instead.....
January 2024
MultiCommander v13.5 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.
UnpackFile( $zip, $root, "*.*" , "OVERWRITEALL, USEEXISTINGQUEUE" );
MC.RunCmd ID="ExplorerPanel.41075"
makes no difference.// get & extract zips
@var $root = GetSourcePath();
@var $arrFiles = FindFiles( $root + "*.zip");
@var $count = arrayCount($arrFiles);
@var $zipFiles = "";
@var $zip;
@var $n1;
// Create ; separated list with all zip files to unpack
for( $n1 = 0; $n1 < $count ; $n1++ )
{
$zip = $arrFiles[ $n1];
$zipFiles += $zip;
$zipFiles += ";";
UnpackFile( $zip, $root, "*.*" , "OVERWRITEALL, USEEXISTINGQUEUE" );
}
MC.RunCmd ID="ExplorerPanel.41075"
---
e05470df6fa74db19ad73aa2c34228ba ? that is a ID of your UserDefinedCommand ?
Then it depends on what that command was using.
@var $arr = GetSourceSelectedPaths();
@var $NameA = PathGetNamePart( $arr );
@var $newText = TitleCase($NameA);
@var $NameB = $newText[0] = StrToUpper( $newText[0] );
{
RenameFile( $arr, $newText, "RENAME_RO" );
}
$textPart[0] = StrToUpper( $textPart[0] );
entry & was going to try it, but decided that I would probably create a conflict/problem. I know!
Sorry,. I don't understand your reasoning how that should work, it make no logical sense
@var $exceptionsArray[] = { "a", "as", "an", "and", "any", "at", "for", "from", "into", "is", "of", "on", "or", "the", "to", };
@var $n;
@var $oldN;
function TitleCase($name)
{
return _TitleCase($name, " ");
}
function _TitleCase($name , $splitchar)
{
@var $result = "";
@var $parts = StrSplit($name , $splitchar); // space and - will split string
@var $cnt = arrayCount( $parts );
for( $n = 0; $n < $cnt ; $n++ )
{
@var $textPart = $parts[ $n ];
// To Lower
$textPart = StrToLower( $textPart );
if( StrFind( $textPart , "-", 0 ) > 0)
{
// Becuse of recursive bug, $n is is overwriten
$oldN = $n;
$textPart = _TitleCase($textPart , "-");
$n = $oldN;
}
if( arrayFind( $exceptionsArray, $textPart ) == -1)
{
// Uppser case on first
$textPart[0] = StrToUpper( $textPart[0] );
}
if( StrLen( $result ) > 0 )
$result += $splitchar;
$result += $textPart;
}
return $result;
}
@var $arr1 = GetSourceSelectedPaths();
@var $items = arrayCount($arr1);
@var $CurrentNameFullPath;
@var $OrgName;
@var $NewName;
@var $n1;
for( $n1 = 0; $n1 < $items; $n1++ )
{
@var $arr = GetSourceSelectedPaths();
@var $NameA = PathGetNamePart( $arr[$n1] );
@var $newText = TitleCase($NameA);
$CurrentNameFullPath = $arr1[ $n1 ];
$OrgName = PathGetNamePart( $CurrentNameFullPath );
$NewName = StrReplace( $OrgName, $NameA, $newText );
RenameFile( $CurrentNameFullPath, $NewName, "RENAME_RO" );
}
@var $char1 = StrSub($NewName, 0, 1);
@var $char2 = StrToUpper( $char1 );
@var $NameB = StrReplace( $NewName, $char1, $char2 );
RenameFile( $CurrentNameFullPath, $NameB, "RENAME_RO" );
for( $n = 0; $n < $items; $n++ )
works for multiple files - it will call the same thing ($arr) in 2 different ways --- which it won't @var $exceptionsArray[] = { "a", "an", "and", "any", "at", "for", "from", "into", "of", "on", "or", "the", "to", };
function TitleCase($name)
{
return _TitleCase($name, " ");
}
function _TitleCase($name , $splitchar)
{
@var $result = "";
@var $parts = StrSplit($name , $splitchar); // space and - will split string
@var $cnt = arrayCount( $parts );
for( $n = 0; $n < $cnt ; $n++ )
{
@var $textPart = $parts[ $n ];
// To Lower
$textPart = StrToLower( $textPart );
if( StrFind( $textPart , "-", 0 ) > 0)
{
// Becuse of recursive bug, $n is is overwriten
$oldN = $n;
$textPart = _TitleCase($textPart , "-");
$n = $oldN;
}
if( arrayFind( $exceptionsArray, $textPart ) == -1)
{
// Uppser case on first
$textPart[0] = StrToUpper( $textPart[0] );
}
if( StrLen( $result ) > 0 )
$result += $splitchar;
$result += $textPart;
}
return $result;
}
@var $arr = GetSourceSelectedPaths();
@var $items = arrayCount($arr);
@var $NameA = PathGetNamePart( $arr );
@var $newText = TitleCase($NameA);
@var $i = 0;
for( $i = 0; $i < $items; $i++ )
{
RenameFile( $arr, $newText, "RENAME_RO" );
}
@var $exceptionsArray[] = { "a", "an", "and", "any", "at", "from", "into", "of", "on", "or", "the", "to", };
...
@var $arrN = StrSplit( $NameA, " ");
@var $Words = $arrN[1];
@var $Char1 = StrSub($Words, 0, 1);
@var $arrN1 = StrToUpper($Char1);
...
using System;
using System.Collections.Generic;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
//Words that will not be capitalized; add words to this list as required
string[] exceptionsArray = { "a", "an", "and", "any", "at", "from", "into", "of", "on", "or", "the", "to", };
List<string> exceptions = new List<string>(exceptionsArray);
//Break the input text into a list of capitalized (not upper case) words
text = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(text.ToLower());
List<string> words = new List<string>(text.Split(new char[] { ' ' }));
//Always leave the first word capitalized, regardless of what it is
text = words[0];
words.RemoveAt(0);
//Check each remaining word against the list, and append it to the new text
foreach (string s in words)
{
if (exceptions.Contains(s.ToLower()))
text += " " + s.ToLower();
else
text += " " + s;
}
return text;
}
}
<str> StrReplace(<str> input, <str> find, <str> with );