Multi Commander > Script
Rename profiles accessed by MS?
Mathias (Author):
--- Quote from: Ulfhednar on December 28, 2016, 10:15:51 ---Sorry to ruin your Xmas break Mathias! :o
Originally I wanted to call an existing rename profile (in the same way as a filter) with a MScript. Couldn't see how to do that. Filters have an ID to call but I have not found ID tags in the rename dialog & didn't dig deeper.
Not all files contain all the same items I want to change. Some have one character to change, others some or all.
I wasn't sure I could apply a single @var to this task. I expected conflicts.
I concluded that with multiple possible case-sensitive rename actions, I needed to queue them discretely, so gave them different @vars.
Would a Function concatenate multiple changes...?
As you know I like to cause headaches with MultiScript - I find it therapeutic. 8) :)
--- End quote ---
I added two new strReplace MultiScript function in 6.9.1, so doing the thing about or similar should be easier.
--- Code: ---// Replace every 'a' and every b and c with the substring "Dragon"
// so if $name is "abcdef" it will be "555def" the replace with can be a substring with many chars. BUT is you include characters there are inlcuded in the replace characters , The result will be strange
$Name = StrReplaceChars( $Name, "abc" , "5" );
// This require that Replace pattern and ReplaceWith is the same lenght, the first char in 'replace' will be replaced with the first char in "replacewith" and so on.
$Name = StrReplaceCharsPairs( $Name, "_ mryxa" , "-eR ms" );
--- End code ---
Ulfhednar:
Thanks Mathias! :D
New Toys! It's like it's Xmas! ...oh wait... :P
I will have some fun with these new commands. 8)
AlanJB:
Hi Mathias.
Are there plans to add StrReplaceChars() and StrReplaceCharsPairs() to the documentation?
If so, I feel some editing coming on ;)
Mathias (Author):
--- Quote from: AlanJB on January 03, 2017, 18:47:08 ---Hi Mathias.
Are there plans to add StrReplaceChars() and StrReplaceCharsPairs() to the documentation?
If so, I feel some editing coming on ;)
--- End quote ---
Hehe yes.. I just forgot about that..
Navigation
[0] Message Index
[*] Previous page
Go to full version