Editing images inside 'Photos.app for OS X' using Photoshop

I was hoping that someone might be able to help me build a macro to simplify/automate the process of editing images from Photos for OS X with an external editing application, like Photoshop. iPhoto provided an option to edit a specific image with an external editor, but Photos for OS X doesn’t. (see here for more)

Instead, you have to export the ‘unmodified original’ version of the image to a temporary location (such as the Desktop), open the exported file in Photoshop to edit the image, then save the edited image and copy it back into Photos for OS X. Major pain in the butt to do over and over, though it does seem like the perfect task to semi-automate using Keyboard Maestro.

Anyone think they might be able to whip together a reliable macro that can be triggered via keyboard shortcut when a single image is selected in Photos for OS X to export the image to the desktop and open it in Photoshop, then perhaps even wait until the ‘Save’ command is performed in Photoshop after which the saved version on the desktop is reimported back into Photos for OS X?

I’d be beyond grateful if anyone could help me with this, as it’s way beyond my capabilities in Keyboard Maestro. Thanks so much!


####Edit: 2015/08/26 06:55

This was working yesterday, but is NOT working now. I have no idea why…

I’m going to leave it up even though it’s not working, because the various pieces are relevant.

I will post a working macro below.

-ccs


Hey Micah,

Photos does seem to be rather dumbed-down, but at least it’s scriptable.

Select some files in Photos. Run this AppleScript from an Execute AppleScript action.

------------------------------------------------------------
set exportPath to (path to desktop folder as text) & (do shell script "date '+Photos Export %Y.%m.%d · %H.%M.%S'")
tell application "Photos"
  set photosSelectionList to selection
  export photosSelectionList to exportPath with using originals
end tell
------------------------------------------------------------

The originals will be exported to a date-stamped folder.

From there it’s easy to script opening things in other apps.

-Chris

Thanks for your help! Unfortunately when it comes to Apple Script, I am completely clueless. I created the following macro, but nothing happens when I try to trigger it using the hotkey I've assigned:

Am I supposed to plug in the actual path to my Desktop folder somewhere (if so, the path is /Users/Studio/Desktop)?

Once I do figure out how to get this initial part of the script working, are you able to help me figure out how to get the second part of the script working as well... i.e. Opening the exported image directly into Photoshop for editing, then immediately reimporting it back into Photos after I save/close it in Photoshop .

Any suggestions would be greatly appreciated... Thanks!

Hey Micah,

Well, I'm flummoxed. I had that code working yesterday, but it's NOT working AT ALL today...

I have no idea why, and that's extremely aggravating.

Oh, well. This macro works with KM7 and OSX 10.10.5.

Export Selected Photos.kmmacros (3.7 KB)

This script has an error-handler, so if for some reason it fails please post the error message.

Here's the script in a .applescript file — which is just a text file — in case there's a problem importing the macro.

Export Photos to Dated Folder.applescript.zip (3.1 KB)

-Chris

Hey Micah,

I see you’re working toward editing an image in Photoshop.

I don’t have Photoshop, so I’ll use GraphicConverter as an example.

This is the same script as in the above macro, but I’ve added a few lines of code to open the exported image(s) in GraphicConverter.

-Chris

------------------------------------------------------------
# Auth: Christopher Stone <scriptmeister@thestoneforge.com>
# dCre: 2015/08/26 05:55
# dMod: 2015/08/26 06:16 
# Appl: Finder, Photos
# Task: Export Selected Images from Photos
# Tags: @Applescript, @Script, @Finder, @Export, @Edit, @Photos
------------------------------------------------------------

try
  
  set exportFolderName to (do shell script "date '+Photos Export %Y.%m.%d · %H.%M.%S'")
  
  tell application "Finder"
    set exportFolderAlias to (make new folder at desktop with properties {name:exportFolderName}) as alias
  end tell
  
  tell application "Photos"
    set photosSelectionList to selection
    export photosSelectionList to exportFolderAlias with using originals
  end tell
  
  tell application "Finder"
    set editFileList to files of exportFolderAlias as alias list
  end tell
  
  tell application "GraphicConverter 9"
    if not running then run
    activate
    open editFileList
  end tell
  
on error e number n
  set e to e & return & return & "Num: " & n
  if n ≠ -128 then
    try
      tell application (path to frontmost application as text) to set ddButton to button returned of ¬
        (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
          default button "OK" giving up after 30)
      if ddButton = "Copy Error Message" then set the clipboard to e
    end try
  end if
end try

------------------------------------------------------------

Hello @ccstone,
your applescript works very well :clap: Since I unfortunately have no idea with the writing of applescripts, I would have a request.

How would you have to rewrite the applescript, so that the original pictures are stored in an existing folder "Yoink" in the FilmFolder? I do not need any additional information about the date or time of the process.

I would be very grateful for your help.