$2
from that line^^Miscellaneous - Questions
Re: Miscellaneous - Questions
Remove
One of my scripts helped you out? Please donate via Paypal
Re: Miscellaneous - Questions
OMG! No way! I never mind it to remove it. Even didn't pay attention on it.
Thanks a lot.
Thanks a lot.
Re: Miscellaneous - Questions
I believe this is maybe so easy but still trying unfortunately couldn't done it by myself.
I'd like to below code also could work for files, please.
I'd like to below code also could work for files, please.
Code: Select all
foreach($folder, <get SelectedItemsPathNames |>, , "e") {
if (exists($folder) != 2) { continue; }
$base = gpc($folder, "base", -2, 1);
$newName = replace(regexreplace($base, "^(.*?)(_Male|_Female)(.*?$)", "$1$2"), "_", " ");
renameitem($newName, $folder);
}
Re: Miscellaneous - Questions
And removing the line with the check if it is a folder doesn't come to your mind? oO
One of my scripts helped you out? Please donate via Paypal
Re: Miscellaneous - Questions
I didn't remove it vice versa I tried to add more lines for files. Thanks a lot. Seems works good.
Re: Miscellaneous - Questions
I would like to add '.' to this line but can't and I tried like this '.|_' unfortunately this doesn't work.
Real version:
Andrew.Smith65.JaneSmith69.Male.AJ6.1.000158-AWW
Expecting result:
Andrew Smith65 Jane Smith69
Code: Select all
foreach($folder, <get SelectedItemsPathNames |>, , "e") {
$base = gpc($folder, "base", -2, 1);
$newName = replace(regexreplace($base, "^(.*?)(.Male|.Female|_Male|_Female)(.*?$)", "$1"), ".|_", " ");
renameitem($newName, $folder);
}
Andrew.Smith65.JaneSmith69.Male.AJ6.1.000158-AWW
Expecting result:
Andrew Smith65 Jane Smith69
Re: Miscellaneous - Questions
Your
Use
regexreplace()
is wrong (you're matching everthing in front of male/female, not only the dot) and inefficient as well"^(.*?)(\.|_)(Male|Female)(.*?$)"
Yeah,".|_"
replace
would search for that exact string. Does it exists (in your example)? Rather not.Use
replacelist()
or another regexreplace()
One of my scripts helped you out? Please donate via Paypal
Re: Miscellaneous - Questions
Unfortunately since first time I shared my AHK code lines. Today I need to share it again that it reached over 700 lines most of them I wrote by myself. Yes I remember that we already talked about this.
So since you and @jupe explained well (I believe so) but I really can't write it by myself again and again. Unfortunately this is really so hard and even so bloody hard for me. Two times I tried to study that part of codes in .pdf documentation and it always open when I try to write some code.
I will try it again in next weekend. Thanks a lot.
So since you and @jupe explained well (I believe so) but I really can't write it by myself again and again. Unfortunately this is really so hard and even so bloody hard for me. Two times I tried to study that part of codes in .pdf documentation and it always open when I try to write some code.
I will try it again in next weekend. Thanks a lot.
Re: Miscellaneous - Questions
You can write up to 700 lines in AHK but you're not able to replace a single command in a XY script file?
Doesn't make sense to me
Doesn't make sense to me
One of my scripts helped you out? Please donate via Paypal
Re: Miscellaneous - Questions
This really looks like so easy and so simple but it took a lot of efforts and consumed a lot of times.
So far works good. Thanks a lot for your great explanations, I really highly appreciate that @highend
Hope nothing wrong in this code.
So far works good. Thanks a lot for your great explanations, I really highly appreciate that @highend
Hope nothing wrong in this code.
Code: Select all
foreach($folder, <get SelectedItemsPathNames |>, , "e") {
$base = gpc($folder, "base", -2, 1);
$newName = replacelist(regexreplace($base, "^(.*?)(\.|_)(Male|Female)(.*?$)", "$1"), ".,_", " ");
renameitem($newName, $folder);
}
Re: Miscellaneous - Questions
#1 question
I use below code to clear .ddd in file or folder name. Its last part of the word in the file or folder.
File name: aaa.bbb.ccc.ddd.txt
I am expecting: aaa.bbb.ccc.txt
Folder name: aaa.bbb.ccc.ddd
I am expecting: aaa.bbb.ccc
#2 question
Why this regex doesn't run? [^\p{L}\d]+
I use below code to clear .ddd in file or folder name. Its last part of the word in the file or folder.
File name: aaa.bbb.ccc.ddd.txt
I am expecting: aaa.bbb.ccc.txt
Folder name: aaa.bbb.ccc.ddd
I am expecting: aaa.bbb.ccc
Code: Select all
foreach($item, <get selecteditemspathnames>, <crlf>, , "No files selected!") {
$base = gpc($item, "base");
$newName = regexreplace($base, "(.(?!.*\.).*(?=))", "");
renameitem($newName, $item, 1);
}
#2 question
Why this regex doesn't run? [^\p{L}\d]+
Re: Miscellaneous - Questions
01.
02. Short answer: Because it has no legs?
Long one: Because VB6 doesn't know this expression for the unicode category "letter"?
Code: Select all
foreach($item, <get selecteditemspathnames>, <crlf>, , "No files selected!") {
if (exists($item) == 2) { $base = gpc($item, "name"); }
else { $base = gpc($item, "base"); }
$newName = regexreplace($base, "\.[^.]+?$");
renameitem($newName, $item, 1);
}
Long one: Because VB6 doesn't know this expression for the unicode category "letter"?
One of my scripts helped you out? Please donate via Paypal
Re: Miscellaneous - Questions
Thank you! It works good.
Re: Miscellaneous - Questions
Width/Height of Video/Image - in a single Column
I use Dimensions, Frame Width, Frame Height in a 3 columns so is it possible to combine all of them in a single custom column?
I use Dimensions, Frame Width, Frame Height in a 3 columns so is it possible to combine all of them in a single custom column?
Re: Miscellaneous - Questions
return
property()
<cc_item>
+ Concatenation
One of my scripts helped you out? Please donate via Paypal