A sample AppleScript and some technical observations on Photos

Hi,


While I've had my own fair share of issues with Photos, I'm overall very happy with it. But I have noticed some quirks, so I thought I'd share them and also share an AppleScript I wrote to help out on some other discussions.


  1. Don't add a KeyWord to more than 1,000 photos at a time as a precaution. Photos crashed when I tried a huge huge number! And it didn't recover, so good job I use Time Machine religiously.

    I've found KeyWord updates in chunks of around 750 to be the best optimum

  2. Talking of Time Machine, I'd noticed that it doesn't backup the database files. I was going to try and research this, but when I lost 80% of my library (see point 1 above), it restored just fine.
    1. After restoring, and starting Photos, it displays a message knowing it has been restored, and does some re-building of the database. But it was a perfect copy. So, kudos to Apple for at least not losing me my library!
    2. On the two occasions in my life I have had to restore (one with iPhoto and the recent one with Photos), I find that the restore in Time Machine takes forever. So, I heartedly recommend this tip to use terminal to restore the library. With a USB3 hard drive, I restored an 85 GB library in around 25 minutes. Stack Exchange
  3. Smart Albums are not visible to AppleScript
  4. When changing or adding a title to an item in Photos, the change is not written to the database until you close Photos. Might be a good idea to close and reopen often if you are doing this much.
  5. I got loads of duplicates when I converted my iPhoto Library. It was a combination of a sync problem I had with PhotoStream and thousands of Zombie files that were hidden in my iPhoto package and imported into Photos during the conversion.
  6. I've been playing with AppleScript to help me tidy up my library. I wrote one script for another discussion, but I share it here, because it will give those that use AppleScript as an amateur (like myself) some clues on how to get a media item and do something with it.

    The documentation says that you can also process moments, but I haven't got that far yet!


I'll share the script and link in a separate post to make it easier to read!

MacBook Air, OS X Yosemite (10.10.3)

Posted on Apr 17, 2015 5:15 AM

Reply
37 replies

Feb 13, 2016 12:17 PM in response to NicFletcher

Hi Nic,

Your "Photos Filename to Title V1.3.scpt" is awesome!

I found after migrating from iPhoto to Photos that I had over 2,800 photos without titles. All of my photos now have titles after running your script. And it only took minutes! You saved me from spending countless hours creating titles from file names or abandoning Photos altogether.

Thank you very much!! I greatly appreciate it.

Aug 11, 2016 8:25 PM in response to NicFletcher

I am a 66 years old photographer and just move my large Aperture library to Photos . My pictures were named : my name_date_number . I have now imported some pictures in Photo and cannot find a way to do the same.


I just cannot believe than in 2016 , I have to write a script to be able to do that . Really !! I have been using Apple for many years but this is really non sense. So frustrated !! This application should not have been released as it is ! I understand that you are trying to help : Apple should hire all of you !!


Thanks Florence jean MBA, Inf

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

A sample AppleScript and some technical observations on Photos

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.