Read xmp:photoshop:DateCreated with a script

Post Reply
Ulrich
Posts: 30
Joined: 14 Jul 21 11:59

Read xmp:photoshop:DateCreated with a script

Post by Ulrich »

Hi,
I'm still enhancing my thubnail status infos ( using a more and more complex pascal script :D )

I would like to read the following metadata information by script:
%xmp:photoshop:DateCreated

I found a script from Hert in the ressouce database that writes this information for selected files, but I still can't transfer this logic for reading this information with a script that is used as thubnail information.

Can someboady help?
Ulrich
Hert
Posts: 7911
Joined: 13 Sep 03 6:24

Re: Read xmp:photoshop:DateCreated with a script

Post by Hert »

Why not use that macro?

Code: Select all

%xmp:photoshop:DateCreated
Or use that macro in a script

Code: Select all

%code
var
  ADate: TDateTime;
  AZoneOffset: Double;
begin
  AZoneOffset := 0.0;
  ADate := ISODateStringToDateTime('%xmp:photoshop:DateCreated', AZoneOffset);
  result := DateTimeToStr(ADate);
end;
%/code
And here is how to read the value yourself

Code: Select all

%code
var
  AXmp: TXMP;
begin
  AXmp := TXMP.Create(False);
  try
    PublicCatalog.LoadXMPForImage(ImageItem, AXmp, PublicOptions.CachedXMP);
    result := Nvl(AXmp.QuickGetProperty('http://ns.adobe.com/photoshop/1.0/', 'photoshop:DateCreated'), 'no date');
  finally
    AXmp.Free;
  end;
end;
%/code
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
Ulrich
Posts: 30
Joined: 14 Jul 21 11:59

Re: Read xmp:photoshop:DateCreated with a script

Post by Ulrich »

Oh wow!
Thank you very much Hert!
The three different versions are perferct to get a better understanding.

Is there any other Object Reference than here? -> https://repository.idimager.com/documentation/
It very hard to find here anything. And if you find an object hat might fit, is the description often missing.
Post Reply