Bug(?) on importing to an album in iPhoto 7.1.3 on Leopard

Hi All

On Tiger (iPhoto 5.0.4) a script waits until iPhoto finished importing photos before it continues. On Leopard (iPhoto 7.1.3) importing runs but the script does not wait it to be finished and continues immediately…

Is it a bug? I may workaround it with a dialog that tells the user to click it away when importing has been done. But this seems to be obvisously not AppleScript like.

Any ideas?

Thomas

Hi Thomas,

iPhoto 7 has an importing property of the application.
It’s true while importing photos

Thank you! That worked. Furthermore I found out how to use code that works with iPhoto 7.1.3/OS X 10.5.2 and iPhoto 5.0.4/OS X 10.4.11 as well.

You’ll have to compile the code under OS X 10.5.2, then export the script as a (Run Only) Carbon Application.

on run
	
	set _fol to (choose folder)
	set _albumname to "import"
		
	tell application "iPhoto"
		
		import from _fol to album _albumname
		
		try
			repeat while importing
			end repeat
		end try
		
	end tell
	
	activate
	display dialog "Import done!" buttons {"OK"} default button 1 giving up after 12
	
end run

This way with iPhoto 7.1.3/OS X 10.5.2 the script waits for the import beeing finished, then goes on. With iPhoto 5.0.4/OS X 10.4.11 it waits by default, then ignores the repeat loop and goes on.

Hint: If saved as an editable Carbon Application you should not open the script within Script Editor/Debugger on OS X 10.4.11 again because then this feature will break.