RTTSoftware Support Forum
PDF-ShellTools => General => Topic started by: marvin on January 12, 2015, 11:48:33 PM
-
I'm testing the program right now and cannot figure out how to set metadata by script.
I reduced the sample script provided to the maximum. Also according to th API documentaion ist seems correct, but the metadata stays unchanged. What am I missing?
My Script:
for (var i = 0; i < pdfe.Arguments.Count(); i++) {
var Filename = pdfe.Arguments(i);
var FileMetadata = pdfe.SelectedFiles(i).Metadata;
FileMetadata['Title']='Test';
if (FileMetadata.CommitChanges()) {
pdfe.echo(Filename + ' - OK');}
}
-
There is nothing wrong with your script. The problem is related to a bug I have just now found.
The scripting functionality is mainly developed while coding for PDF Explorer. Differences in the internal data holding structures, between PDF Explorer and PDF-ShellTools, totally disabled the setting of metadata from the PDF-ShellTools scripting functionality. It's working from PDF Explorer.
I have just fixed it, so it will be OK in the next release.
Meanwhile, you may use the command line interface (http://www.rttsoftware.com/Manuals/STIndex.htm?pageURL=ST/English/InfoEdit.htm#cmdline), or try your script from the PDF Explorer (http://www.rttsoftware.com/pdfe.html) my scripts functionality (http://www.rttsoftware.com/Manuals/Index.htm?pageURL=PDFE/English/MyScripts.htm).
Thank you very much for reporting the problem.