2 Replies Latest reply: Jun 1, 2012 1:57 PM by alternapop
alternapop Level 3 Level 3 (765 points)

I'm traveling tomorrow to Europe and am only taking my iPad and camera.  I'm planning on using an SD card reader to upload my photos/videos to my iPad, then use Dropbox on the iPad to copy my daily shots to my Dropbox account.

 

I'm thinking that I'll have an AppleScript on my home computer's  /Dropbox/europe/  folder to look for newly added data and then auto import that into iPhoto.

 

What's the best way to handle this?

 

I got it working with a couple of test images but when iPhoto sees photos that it's already imported it asks me if I want to import in the duplicates or skip them.  I'd like to skip them or write the AppleScript in a way that handles this.

 

I'm also fine with copying the photos out of the Dropbox folder into a separate folder elsewhere and not using iPhoto.

 

I'm just trying to theft proof my data in case my iPad gets stolen or if my Dropbox goes goofy and deletes the photos.  Maybe copy newly added data to a designated directory outside of the Dropbox folder?  How can I do this?

 

Any suggestions?

 

I'm running 10.6.8


iMac, Mac OS X (10.6.8)
  • 1. Re: How can I handle iPhoto's "import duplicates" prompt when using AppleScript folder actions
    Camelot Level 8 Level 8 (45,790 points)

    The nature of your question implies that you're unfamiliar with Folder Actions...

     

    I'd like to skip them or write the AppleScript in a way that handles this.

     

    By their very nature, Folder Actions are passed a list of newly-added files. Your Folder Action script should look something like:

     

    on adding folder items to my_folder after receiving the_files

      -- your code goes here

    end adding folder items to


    where, in this case, the_files is a list of the newly-added files. It won't include pre-existing files, so all you need to do is iterate through the_files and you're set. Something like:

     

    on adding folder items to my_folder after receiving the_files

              tell application "iPhoto"

                        repeat with each_photo in the_files

                                  try

                                            import each_photo to album "Europe 2012"

                                  end try

                        end repeat

              end tell

    end adding folder items to


    The only caveat here that I can think of is the fact it's a DropBox folder, so there might be some odd latency in the files appearing in the directory, but I don't use Dropbox to know.

     

    Note that in the above I import each photo independently, via a repeat loop. This might not be necessary, and you might be able to pass the entire the_files variable to the import command to have all the images imported in one go - I haven't tried that, though.

  • 2. Re: How can I handle iPhoto's "import duplicates" prompt when using AppleScript folder actions
    alternapop Level 3 Level 3 (765 points)

    I was using Automator to create the Folder Action and your reply helped me realize that I had one extra unnecessary step in my Automator action.

     

    I had a Finder action first and then a Photo action when I only needed the second one.

     

    Thanks!