Tag (for Folder Name :-1) - I think the user manual is incorrect?
Hi all,
[EDIT: for some reason in this post & title I can't enter the actual tag that returns a foldername.
I had a whole other section on JS but the forum breaks it, so I removed it. Maybe I'll add some screenshots later]
https://www.advancedrenamer.com/user_guide/tags_filename
If you use [the folder-name tag] you probably know this, but the user manual says that returns the highest-level folder in the directory path.
(from user manual on ):
> "A negative index selects a folder from left to right.
> [...] for c:\programs\games\new\mine sweeper\highscore\file.txt [the folder-name tag] returns new.
> [...] [the folder-name tag with a parameter of -1] returns programs."
Actually, [folder-name tag -1] returns the drive letter in uppercase. [folder-name tag -2] returns "programs".
A small thing, but could be useful in copy/move modes, and in javascript for constructing new paths.
Best,
DF
[EDIT: for some reason in this post & title I can't enter the actual tag that returns a foldername.
I had a whole other section on JS but the forum breaks it, so I removed it. Maybe I'll add some screenshots later]
https://www.advancedrenamer.com/user_guide/tags_filename
If you use [the folder-name tag] you probably know this, but the user manual says that returns the highest-level folder in the directory path.
(from user manual on ):
> "A negative index selects a folder from left to right.
> [...] for c:\programs\games\new\mine sweeper\highscore\file.txt [the folder-name tag] returns new.
> [...] [the folder-name tag with a parameter of -1] returns programs."
Actually, [folder-name tag -1] returns the drive letter in uppercase. [folder-name tag -2] returns "programs".
A small thing, but could be useful in copy/move modes, and in javascript for constructing new paths.
Best,
DF
Reply to #1:
BTW, that <subfolder> tag is neat. Kim snuck that in on version 4.21 and I hadn't noticed it [forgot about it] until now.
BTW, that <subfolder> tag is neat. Kim snuck that in on version 4.21 and I hadn't noticed it [forgot about it] until now.
Reply to #1:
OK, here's the JS I was talking about earlier. This first example just walks the file's path using app.parseTags and the [folder name tag with negative indexes] and places the drive, then each folder name--shallowest to deepest--in an array:
https://drive.google.com/file/d/1dArS-HK2rza_QP4mz0uQ-Nxqb7_ QnlOy/view?usp=sharing
And here is code to create a "reversed" path and move the file to it:
https://drive.google.com/file/d/1GbrgiHvFF_sEU0Zr54Zp8JVlkt2 buLvc/view?usp=sharing
And this creates one directory with former folder names separated by a long-dashes:
https://drive.google.com/file/d/1yJYp_C4wql-f-H7WzLnN3yYhIez Uem6h/view?usp=sharing
Thanks to both of you for tuning in. :)
OK, here's the JS I was talking about earlier. This first example just walks the file's path using app.parseTags and the [folder name tag with negative indexes] and places the drive, then each folder name--shallowest to deepest--in an array:
https://drive.google.com/file/d/1dArS-HK2rza_QP4mz0uQ-Nxqb7_ QnlOy/view?usp=sharing
And here is code to create a "reversed" path and move the file to it:
https://drive.google.com/file/d/1GbrgiHvFF_sEU0Zr54Zp8JVlkt2 buLvc/view?usp=sharing
And this creates one directory with former folder names separated by a long-dashes:
https://drive.google.com/file/d/1yJYp_C4wql-f-H7WzLnN3yYhIez Uem6h/view?usp=sharing
Thanks to both of you for tuning in. :)
Reply to #3:
> > Thanks to both of you for tuning in. :)
Huh? Are you saying that Kim is of two minds on this? ;)
There's only one guy who can correct the manual.
Regards,
Randy
> > Thanks to both of you for tuning in. :)
Huh? Are you saying that Kim is of two minds on this? ;)
There's only one guy who can correct the manual.
Regards,
Randy
Reply to #4:
No, my friend, I was talking about the javascript portion of our program... :)
I assume you and Kim will read this, and when he has time he'll fix the manual (or tell me why I'm wrong LOL). Probably not many more will read my previous js-related post.
Best,
DF
No, my friend, I was talking about the javascript portion of our program... :)
I assume you and Kim will read this, and when he has time he'll fix the manual (or tell me why I'm wrong LOL). Probably not many more will read my previous js-related post.
Best,
DF
Reply to #5:
Well if you want me to rag on... Uh I mean code-review... your JS you need to say so. ;P
Otherwise I assume it works the way you want and file it away for if I ever need to do something similar.
Best,
Randy
Well if you want me to rag on... Uh I mean code-review... your JS you need to say so. ;P
Otherwise I assume it works the way you want and file it away for if I ever need to do something similar.
Best,
Randy
Reply to #6:
HA! Nah, that's ok. Thanks, though... :)
HA! Nah, that's ok. Thanks, though... :)