Highlighted

How to remove the "Author" value and write a new author name

Explorer ,
Jul 19, 2016

Copy link to clipboard

Copied

Hello,

I'm a dummy with scripting. I hope some experts can help me.

I'm working with FM11 and extendscript.

Now we have to insert metadata into the file info like "Author", "Title", "Keywords",....

As far I found the way to do it!

#target framemaker

var doc = app.ActiveDoc; 

var info = doc.PDFDocInfo;

var doctype = prompt("Possible cases: Installation manual, Operation manual, Installation and operation manual, Installer reference guide, User reference guide, Installer and user reference guide","Installation manual","Please input the type of manual");

info.push ("Author"); 

info.push (doctype); 

doc.PDFDocInfo = info;

Imagine that I run the script again, fill in a new entry in the inputbox, then the new entry does NOT overwrite the existing entry in the FM document.

Can somebody tell me (in dummy javascript language and step-by-step), how I can solve this issue for me?

Kind regards

TOPICS
Scripting

Views

219

Likes

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

How to remove the "Author" value and write a new author name

Explorer ,
Jul 19, 2016

Copy link to clipboard

Copied

Hello,

I'm a dummy with scripting. I hope some experts can help me.

I'm working with FM11 and extendscript.

Now we have to insert metadata into the file info like "Author", "Title", "Keywords",....

As far I found the way to do it!

#target framemaker

var doc = app.ActiveDoc; 

var info = doc.PDFDocInfo;

var doctype = prompt("Possible cases: Installation manual, Operation manual, Installation and operation manual, Installer reference guide, User reference guide, Installer and user reference guide","Installation manual","Please input the type of manual");

info.push ("Author"); 

info.push (doctype); 

doc.PDFDocInfo = info;

Imagine that I run the script again, fill in a new entry in the inputbox, then the new entry does NOT overwrite the existing entry in the FM document.

Can somebody tell me (in dummy javascript language and step-by-step), how I can solve this issue for me?

Kind regards

TOPICS
Scripting

Views

220

Likes

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
Jul 19, 2016 0
jessevic LATEST
Explorer ,
Jul 19, 2016

Copy link to clipboard

Copied

This is the solution!

var doc = app.ActiveDoc;

var info = doc.PDFDocInfo;

var info=new Strings();

var doctype = prompt("Possible cases: Installation manual, Operation manual, Installation and operation manual, Installer reference guide, User reference guide, Installer and user reference guide","Installation manual","Please input the type of manual");

info.push ("Author"); 

info.push (doctype); 

doc.PDFDocInfo = info;

As test I wrote something in the Author field, I re-run the script and put another value into the inputbox. Result is that the original/wrong entry was deleted and/or overwritten with the new one.

Likes

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
Reply
Loading...
Jul 19, 2016 0