Author Topic: Script doesn't set metadata  (Read 4210 times)

0 Members and 1 Guest are viewing this topic.

marvin

  • Newbie
  • *
  • Posts: 2
Script doesn't set metadata
« 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');}
             }

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Script doesn't set metadata
« Reply #1 on: January 13, 2015, 01:37:40 AM »
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, or try your script from the PDF Explorer my scripts functionality.

Thank you very much for reporting the problem.