Renaming selected files with a property
Posted: 29 Nov 2015 16:46
Hello,
I am trying to rename multiple pdf files with their DocTitle property.
Here is a script how to rename one selected file:
It works great but I would like to rename a bunch of files.
I guess foreach loop is way to go, but with this script it does not work:
What I get is just this kind of stuff:
DocTitleOfTheFirstSelectedFile.pdf
DocTitleOfTheFirstSelectedFile-1.pdf
DocTitleOfTheFirstSelectedFile-2.pdf
DocTitleOfTheFirstSelectedFile-3.pdf
and so on.
I also tried this but got the same results:
I am trying to rename multiple pdf files with their DocTitle property.
Here is a script how to rename one selected file:
Code: Select all
::rename b, "<prop doctitle>";I guess foreach loop is way to go, but with this script it does not work:
Code: Select all
::foreach($item, <get selecteditemspathnames |>, "|") {rename b, "<prop doctitle>",,$item;}DocTitleOfTheFirstSelectedFile.pdf
DocTitleOfTheFirstSelectedFile-1.pdf
DocTitleOfTheFirstSelectedFile-2.pdf
DocTitleOfTheFirstSelectedFile-3.pdf
and so on.
I also tried this but got the same results:
Code: Select all
::foreach($item, <get selecteditemspathnames |>, "|") {$property=property("doctitle");rename b, "$property",,"$item";};