Copy link to clipboard
Copied
I found a script that will let me autofill the InDesign document metadata with the file name, but it puts in the .indd extension at the end. Is there a way to get the script to leave out the file extension in the metadata title? Here is the script I'm using:
tell application "Adobe InDesign CC 2017"
tell active document
set document title of metadata preferences to name
--set x to document title of metadata preferences
save
end tell
end tell
And here is what my metadata looks like after I run it. I just don't want the .indd in there. Suggestions?

I don't have a Mac at hand at the moment so I'd rather translate this into JavaScript:
main();
function main() {
try {
var doc = app.activeDocument;
doc.metadataPreferences.documentTitle = doc.name.replace(/\.indd$/i, "");
}
catch(err) {}
}
Anyway, if you want to edit the AS version, you can find a solution via google. For example, here. (note: you should change 3 to 4. -- four characters in the indd extension).
Hope it helps.
— Kas
Copy link to clipboard
Copied
I don't have a Mac at hand at the moment so I'd rather translate this into JavaScript:
main();
function main() {
try {
var doc = app.activeDocument;
doc.metadataPreferences.documentTitle = doc.name.replace(/\.indd$/i, "");
}
catch(err) {}
}
Anyway, if you want to edit the AS version, you can find a solution via google. For example, here. (note: you should change 3 to 4. -- four characters in the indd extension).
Hope it helps.
— Kas
Copy link to clipboard
Copied
Fantastic, thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now