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)

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.


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?

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

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

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

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:


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

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.

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