Tuesday, October 22, 2019

#1 2019-05-19 03:25:40 am

Grant Symon
Member
Registered: 2004-06-01
Posts: 39

Help with a script to change image date to import date in Aperture

Hi,

I'm trying to do some cleaning up of my Aperture libraries, to prepare for moving to another solution (since Apple have finally dumped us pros completely, having recently announced that Aperture, which is 64bit, won't run in MacOS 10.15).

Specifically, I'm trying to work out how to alter one of the scripts that Apple provides in the Aperture Applescript Dictionary in order to do something that I guess should be very simple:

• Set File Date to Import Session (date)

My problem is getting the tag for the Import Session to be recognised when I run the script.  The "Aperture_3_AppleScript_Reference.pdf" says this about the tag:

(PDF can still be found here - https://bit.ly/2JsVIR6)



Aperture other tag naming


I'm trying to use this example script that I found in the Script Editor's Aperture Dictionary, for changing the File Date:


Example
The following script adjusts the EXIF image date of a selection of image versions by decreasing the hour by one.

Applescript:


tell application "Aperture"
set imageSel to (get selection)
repeat with i from 1 to count of imageSel
tell item i of imageSel
set imageDate to value of EXIF tag "ImageDate"
end tell
set imageDate to imageDate - (1 * hours)
adjust image date imageDate of images {item i of imageSel}
end repeat
end tell

There is another point, which is that the format of the 2 date fields is slightly different and I don't know, but I'm guessing that the EXIF one might not work correctly if it's not in a standard format?


Aperture date formats


Can anyone help me put these 2 things together and save me many many hours of manual labour?? smile smile

Model: MBPro
AppleScript: 2.7
Browser: Safari 605.1.15
Operating System: macOS 10.14


Filed under: aperture, imageDate

Offline

 

#2 2019-09-21 05:10:17 pm

Derick
Member
Registered: 2007-05-26
Posts: 18

Re: Help with a script to change image date to import date in Aperture

Did you ever figure this out? Thanks for the link to the manual BTW.

Offline

 

#3 2019-09-21 06:04:43 pm

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 5069

Re: Help with a script to change image date to import date in Aperture

Well. It looks from the document and Grant's script as if the value of an 'image version''s Import Session is obtained by getting the 'value' of its 'other tag' "ImportGroup", but what it all means and what form the value takes, I couldn't say:

Applescript:


tell application "Aperture"
   set imageSel to (get selection)
   repeat with i from 1 to count of imageSel
       tell item i of imageSel
           set importSession to value of other tag "ImportGroup"
       end tell

   end repeat
end tell


NG

Offline

 

#4 2019-09-21 11:32:20 pm

Derick
Member
Registered: 2007-05-26
Posts: 18

Re: Help with a script to change image date to import date in Aperture

Thanks.  I ended up looking at some length at https://github.com/regenschein71/ApertureExport which has a quite robust script which should be helpful to anyone trying to use AppleScript to get photos out of Aperture.

In the end, though, I realised that importing my Aperture libraries into Photos, then exporting the image files from Photos actually accomplished what I needed (converting a bunch of Aperture metadata to keywords), without any scripting.

Offline

 

#5 2019-09-22 03:06:06 am

Grant Symon
Member
Registered: 2004-06-01
Posts: 39

Re: Help with a script to change image date to import date in Aperture

Hi Derick,

I did much like yourself and found a workaround.  I discovered I had a *lot* of old Tif files that are no longer supported and are unreadable by modern apps.  In the end I used Apertures 'Managed' and 'Referenced' trick to move them out, batch convert to a modern Tiff format, change their names back to the original, replace them in the original Referenced folder and on relaunching Aperture, it was none the wiser.  All dates retained, all Meta retained.

The reason I did this, is because as you've discovered, Photos, like iPhoto before it, shares a library structure with Aperture.  So converting your Libraries to Photos is the absolute best (and only) way of preserving all that information.  Of course ... even though it's in there, Photos won't display it and you can't use Photos for metadata in the same way you can with Aperture.

*However*!!

There is perhaps finally some light at the end of the tunnel, because Apple, having royally screwed pro photographers when they shut down Aperture, have decided, with the release of MacOS 10.15, to open up the Photos library to 3rd party developers!  Yay!

That's good news, but there's actually even better.  It 'looks like' Nik Baht, former Senior Lead on Aperture and long time Apple engineer, is planning on adding Aperture like DAM features to his already excellent RAW Power app.  Obviously, he can do this, because since the Apple Developer's conference, he now has full access to the Photos database.

So I'm quietly optimistic that we may see something in the coming months, that will allow us to effectively, totally move our Aperture libraries, into a new (and very similar) app.

Maybe give Nik a little encouragement?  gentlemencoders.com

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)