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

Write metadata in indb (indesign book) by an extendscript

Explorer ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Hello,

I found a manner to insert metadata in the File info of a document, but I search for a manner to do that on book level.

Is there a possibility to do that? In my code below, extendscript crashes on the line "if (book.textVariables".

I also did not found an answer on the internet if it is possible or not.

Kind regards

var book=app.activeBook

var myText=prompt("Installation manuals, Operation manuals, Installer reference guide, User reference guide, Option handbooks, General safety precautions, Declaration of Conformity. In case you have an Information and operation manual, you must input Installation manuals; Operation manuals (remark the ;)","Installation manuals","Fill in the required tags");

if (book.textVariables.item('Document Title').isValid){

    book.textVariables.item('Document Title').variableOptions.contents = myText;

}

else {

    // there's no variable named 'Document Title'

}

TOPICS
Scripting

Views

884

Translate

Translate

Report

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
Guru ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Hi

Books don't have textVariables, documents do.

There's no metadataPreferences properties for books either, so that could explain why you can't find anything on it.

I think your looking for something that can't be found, or that I don't know what your looking for,

Trevor

Votes

Translate

Translate

Report

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
Explorer ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Thanks for answer. If I create a pdf of the indesign book file, the filename of the bookfile will be automatically inserted in the metadata. Really no way at all to force the change of the metadata by an inputbox?

There is maybe an option to first create all pdf's of book files and after creation running a script by extendscript in acrobat to modify the metadata. But it sounds so strange that you cannot change the metadata directly in Indesign. 🙂

Votes

Translate

Translate

Report

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
People's Champ ,
Jan 18, 2017 Jan 18, 2017

Copy link to clipboard

Copied

What you describe is feasible somehow but hazardous to say the least. You can imagine a script that would open every single file that is attached to a book, so you can write the book name in the xmp data. But, what if the file is removed from the book, what if the file is shared across multiple books ?

Votes

Translate

Translate

Report

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
Guru ,
Jan 18, 2017 Jan 18, 2017

Copy link to clipboard

Copied

Just thinking out loud.

I think you can use the XMP library from InDesign or whatever app (Illustrator, ESTK, Photoshop etc.) you want to set the metadata on any file (i.e. mp3, mp4, png, pdf etc.  ).

I think the documentations in the Bridge SDK.

There's 3 PDFs on the topic (I think it's a few hundred pages - but it's easy reading and you can jump around )

One can Google it.

If so after the PDF's been generated one can automatically set the PDFs desired XMP values with InDesign.

I think that even if the PDF open it should still work you will just not see the new XMP until the PDFs reopened.

Trevor

Votes

Translate

Translate

Report

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
Guru ,
Jan 18, 2017 Jan 18, 2017

Copy link to clipboard

Copied

This method would avoid the hazards that Loic described

Votes

Translate

Translate

Report

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
Guru ,
Jan 19, 2017 Jan 19, 2017

Copy link to clipboard

Copied

Trevorׅ wrote:

If so after the PDF's been generated one can automatically set the PDFs desired XMP values with InDesign.

Trevor

Votes

Translate

Translate

Report

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
People's Champ ,
Jan 19, 2017 Jan 19, 2017

Copy link to clipboard

Copied

Yeah you can do it with a PDF for sure. Was just saying it wasn't fro indb as asked by our friend

Votes

Translate

Translate

Report

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
Guru ,
Jan 19, 2017 Jan 19, 2017

Copy link to clipboard

Copied

Just noticed that chapter 10 of the JavaScripts Tools Guide is on "Scripting Access to XMP Metadata"

So you can see from there how to apply the metadata to the PDFs from InDesign

Votes

Translate

Translate

Report

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
People's Champ ,
Jan 19, 2017 Jan 19, 2017

Copy link to clipboard

Copied

Hi @Trevor,

Unless I am wrong indb files can't host XMP metadata. At least when I try to edit an indb xmp through bridge, fields are greyed. So I think it's a deadend anyway.

Capture d’écran 2017-01-19 à 10.12.10.png

Votes

Translate

Translate

Report

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
People's Champ ,
Jan 20, 2017 Jan 20, 2017

Copy link to clipboard

Copied

LATEST

Marijan Tompa also introduced this in a more friendly manner with a series of blog posts:

xmp | Search Results | IndiSnip [InDesign® Snippets]

Votes

Translate

Translate

Report

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