Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Autofill metadata title with file name, but without extension

Community Beginner ,
Oct 04, 2017 Oct 04, 2017

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?

Screen Shot 2017-10-04 at 11.51.43 AM.png

TOPICS
Scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Oct 04, 2017 Oct 04, 2017

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

Translate
Valorous Hero ,
Oct 04, 2017 Oct 04, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 04, 2017 Oct 04, 2017
LATEST

Fantastic, thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines