Rename folder with content from a file inside that same folder?

Advanced Renamer forum
#1 : 01/06-22 04:48
Posts: 1
Alright, so i have exactly 73 folders with random names, some with a "metadata.xml" file, that inside contains the name i want to put in the base folder


Inside the file:

<?xml version="1.0" encoding="UTF-8"?>
<name>[Name I Want]</name>
[the rest]

How can i change the big-number folder's name to the mod name in the file inside it?

can i get uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh pain?

01/06-22 04:48
#2 : 03/06-22 12:08
David Lee
David Lee
Posts: 961
You can read lines from a file using the <File Line> tag.
Call the tag from a script using app.parseTags() and extract the name using a regular expression:

xmlFile = "metadata.xml";
tag = '<File Line:3::"' + item.path + +'\\' + xmlFile + '">';
if (fileLine = app.parseTags(tag)) return fileLine.match(/>(.*)</)[1];

03/06-22 12:08