You are here

9 posts / 0 new
Last post
What is the best way to automate Photos? #1
bjurasz's picture
by bjurasz
March 30, 2016 - 4:15am

Ok, so Apple decided against giving us any form of batch anything whatsoever in Photos.  Dammit.

What is the best way to automate edits?  Suppose I have copied adjustments and I want to paste them to a selection of images w/o manually doing a paste on each image?

What if I want to automatically apply a set of predefined adjustments (say, auto enhance followed by auto levels? keep it simple here) to a selection of images?

Personally I like Photos, mostly.  But it is a HORRIBLE environment for RAW shooters, whereas Aperture was a dream for that.  :(

 

Bill Jurasz
Austin Texas

Krakatoa Sundra's picture
by Krakatoa Sundra
April 3, 2016 - 6:54pm

You may automate Photos for OS X with Applescript. Apple provided Applescript library for the power users. Yay!!!! This will allow you to just about everything you would like to automate. https://photosautomation.com/scripting/script-library.html

Robert Ke
twitter: rke21

also at:
instagram: rke21
facebook: outdoorphotographynow

Krakatoa Sundra's picture
by Krakatoa Sundra
April 3, 2016 - 7:06pm

As far as I can see, the library is already available in Applescript Editor. You only need to open the Dictionary and select Photos.app. You can use Applescript, Javascript or Objective-C. It's easiest to use Applescript. But you can use Javascript if you are familiar with that.

This will allow you to automate Photos. you can do all sorts of stuff!!!!

Robert Ke
twitter: rke21

also at:
instagram: rke21
facebook: outdoorphotographynow

Krakatoa Sundra's picture
by Krakatoa Sundra
April 3, 2016 - 7:15pm

You an also use Automator. It's easier because you don't have to write any scripts but isn't as powerful.

Robert Ke
twitter: rke21

also at:
instagram: rke21
facebook: outdoorphotographynow

Angus Gibbins's picture
by Angus Gibbins
April 16, 2016 - 6:55pm

Not sure if this is helpful.

https://support.apple.com/kb/PH21319?locale=en_US

Copy and paste adjustments

After you adjust a photo, you can copy the adjustments that you’ve made and paste them on other photos. You can only paste adjustments onto one photo at a time. 

  1. Double-click a photo you’ve made adjustments to, then click Edit.

  2. Choose Image > Copy Adjustments.

  3. Double-click the photo to which you want to apply the adjustments, then click Edit.

  4. Choose Image > Paste Adjustments.

Tip:    You can also Control-click a photo and choose Copy Adjustments or Paste Adjustments.

 

bjurasz's picture
by bjurasz
June 1, 2016 - 4:38am

Thanks everyone.  I’ve never had a ton of success with AppleScript, period.  The problem with any language that tries to look like a natural language is that it never is a natural language. :)  So I find it rather confusing to read.  On the other hand, I read C++ and Python very quickly.  Go figure.

Any rate, what I want to be able to do, as a start, is very simple really.  I want to be able to add a keyword to every image in either a particular album, or of all selected images.  Either would be fine with me.  Right now I can’t even get AppleScript to tell me the name of the currently selected photo!  Argh!  Seems simple enough!

Bill Jurasz
Austin Texas

bjurasz's picture
by bjurasz
June 1, 2016 - 4:54am

Ok, a quick example script that almost works.  I have a script that I want to loop through every photo in an album called “For Scripting” and I want to add a keyword “test” to each of those images.  I seem to be clobbering all existing keywords for the image doing this though, but I’m getting closer.  Need to append a keyword to an existing list.  

tell application “Photos”

    set albSource to “For Scripting”

    set srcContainer to container albSource

    set myList to every media item in srcContainer

    repeat with theItem in myList

        set keywords of theItem to “test”

    end repeat

end tell

Bill Jurasz
Austin Texas

bjurasz's picture
by bjurasz
June 1, 2016 - 5:09am

Closer, I’m trying to grab the current keyword list and then add a new keyword to the end of that list and then write the new keyword list to the image.  But it appears this code barfs if the image already has more than one keyword in it:

tell application “Photos”

    set albSource to “For Scripting”

    set srcContainer to container albSource

    set myList to every media item in srcContainer

    repeat with theItem in myList

        set kbList to keywords of theItem

        set newKbList to {kbList, “Disney”}

        set keywords of theItem to newKbList

    end repeat

end tell

Bill Jurasz
Austin Texas

bjurasz's picture
by bjurasz
June 3, 2016 - 4:40am

Ok, so a script here works.  Though it crashed Photos once for me.

https://photosautomation.com/scripting/index.html

Bill Jurasz
Austin Texas

You may login with either your assigned username or your e-mail address.
Passwords are case-sensitive - Forgot your password?
randomness