AppleScript which loads image in iPhoto from folder

  • susancbk
  • Proficient
  • Proficient
  • susancbk
  • Posts: 293
  • Loc: New York City

Post 3+ Months Ago

What im attempting to do is put an AppleScript on a folder so that whenever I drop an image into that folder it loads up iPhoto and imports it.

I used this similar example as my starting ground : http://henrik.nyh.se/2006/12/automatica ... nto-iphoto

and came up with this
Code: [ Select ]
on adding folder items to this_folder after receiving added_items
    tell application "iPhoto"
        import from added_items
        delay 5 -- wait for import to finish
        tell (the first album whose name is "Last roll") to select photos
        assign keyword string "Eye-fi"
        select (the first album whose name is "Eye-fi")
    end tell
end adding folder items to
  1. on adding folder items to this_folder after receiving added_items
  2.     tell application "iPhoto"
  3.         import from added_items
  4.         delay 5 -- wait for import to finish
  5.         tell (the first album whose name is "Last roll") to select photos
  6.         assign keyword string "Eye-fi"
  7.         select (the first album whose name is "Eye-fi")
  8.     end tell
  9. end adding folder items to


Its working fine on my powerbook g4 , with iphoto 5.0.4

However, when tried on a mac book, with the latest version of iphoto it starts to import then fails with an Unreadable Files error...however there's no files listed.

Here's a link to a screenshot of the error message (the screenshot also shows my script)
http://www.screencast.com/users/susanBuck/folders/Jing/media/f34a1d3a-aa65-4c63-92f6-8d98e22da285

Any Ideas?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • geowar
  • Born
  • Born
  • geowar
  • Posts: 1

Post 3+ Months Ago

Instead of hardcoding a fixed delay time that could be too short or too long use a repeat while (importing) loop:

repeat while (importing)
delay 0.5 -- wait 1/2 second and try again
end repeat

This will loop until iPhoto is done importing and then continue.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 2 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.