Read xmp:photoshop:DateCreated with a script

Post Reply
Ulrich
Posts: 25
Joined: 14 Jul 21 12:59

Read xmp:photoshop:DateCreated with a script

Post by Ulrich » 20 Aug 21 10:44

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: 6970
Joined: 13 Sep 03 7:24

Re: Read xmp:photoshop:DateCreated with a script

Post by Hert » 21 Aug 21 8:14

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 need product support then please send a message

Ulrich
Posts: 25
Joined: 14 Jul 21 12:59

Re: Read xmp:photoshop:DateCreated with a script

Post by Ulrich » 21 Aug 21 9:47

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