I have an Android phone and a MacBook, and what I am trying to figure out is a way to do bi-directional sync between the OS X Yosemite's new Photos app and my device's internal storage. So far, I am using DropSync to do a two-way sync between my device photos and storage in Dropbox, and that works fine. The next step that I thought I could do was use Automator to force sync that particular folder with Photos app, but I cannot seem to find any option in Automator that works with Photos - all I have is iPhoto. Is there any way to achieve this?

P.S. I even tried the new Google Photos, but that doesn't do two-way sync with my device's internal memory if I delete something from the Photos library.

Here is how you can sync from Dropbox (or a directory of your choosing) into Photos, when new photos are added:

  1. Open Automator, and create a "Folder Action" enter image description here
  2. On the top where it says "Folder Action receives files and folders added to" select "Choose folder", then "Other", and select your Dropbox folder (or whichever directory contains your photos)
  3. Add a single Run AppleScript action with the following code:

    on run {input, parameters}
        set file_strings to {}
        repeat with current_file in input
            set file_as_string to (current_file as string)
            if words -2 through -1 of (do shell script "file --mime-type " & quoted form of (POSIX path of file file_as_string as string)) contains "image" then
                set file_strings to file_strings & {(file_as_string) as alias}
            end if
        end repeat
    
        tell application "Photos" to import file_strings
    end run
    

    Your Folder Action should look like this: enter image description here

  4. Now save it with a name of your choosing, and from now on, photos added to the folder you chose will be imported to Photos.

Let me know if anything goes wrong!

I have an HTC One S and was using the HTC Sync Manager desktop app. It has the option to import photos to iPhoto after syncing:

enter image description here

Unfortunately with the migration to new Photos app this is no longer useful.

So I found William T Froggard's excellent answer above. In the end I was able to use a slightly simpler variation I'll detail below.

Firstly the useful thing to recognise is that even though I've turned off the iPhoto option, HTC Sync Manager is still copying photos to the mac. They go to /Pictures/HTC_DEVICE_MEDIA and then various cryptically named subfolders under there.

We can use some of Apple's ready provided snippets to make the scripting simpler in Automator, hopefully this screenshot will suffice:

enter image description here

  1. "Get Folder Contents" ...this step ensures we look through all the subfolders, not just the files in the top level (there are none).
  2. "Filter Finder Items" ...I want to import the videos as well, this step also filters out any file types that are not importable.
  3. "Run AppleScript" ...since we already have a filtered list of importable files we can just pass input straight to Photos for importing. By including return input at the end we could add another step at the end of the chain if we wanted (no need here, but I guess it's good practice in these kind of scripts).
  • Only problem I found is... the Folder Action doesn't actually run when I add stuff to the folder, whether via HTC Sync Manager or just manually dropping stuff in there via Finder. so it's useless at the moment – Anentropic Feb 19 '16 at 22:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.