Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iPhoto Scripting Errors



I have an Applescript that manipulates albums in iPhoto, and requires information about album types. Conveniently, the "album" Applescript keyword for iPhoto has a "type" property, which determines whether the album is a "regular album, smart album, book album, slideshow album, etc." For the most part, end users are able to run my Applescript with no problem. However, a small group of users are getting errors. To investigate these errors, I have had a few affected users run the following test scripts in Script Editor:

--------------------------
-- AlbumTest1.scpt --
--------------------------

try
tell application "iPhoto"
set albumList to id of every album
repeat with albumId in albumList
set albumType to type of album id albumId
end repeat
end tell
on error errorText number errorNumber
tell application "iPhoto" to set myVersion to version
set myString to "AlbumTest1: iPhoto v" & myVersion & " " & errorText & " " & errorNumber
end try


--------------------------
-- AlbumTest2.scpt --
--------------------------

try
tell application "iPhoto"
repeat with n from 1 to number of albums
set albumType to type of album n
end repeat
end tell
on error errorText number errorNumber
tell application "iPhoto" to set myVersion to version
set myString to "AlbumTest2: iPhoto v" & myVersion & " " & errorText & " " & errorNumber & " (n is: " & n & ")"
end try


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

Both these scripts execute fine for me, and I end up with the text "trash album" in the Result pane, as this is the type of the last album queried by the repeat loop. However, the affected users typically report the following results:

AlbumTest1.scpt:
"AlbumTest1: iPhoto v6.0.5 iPhoto got an error: Can't make id of every album into type reference. -1700"


AlbumTest2.scpt:
"AlbumTest2: iPhoto v6.0.5 iPhoto got an error: Can't make type of album 1 into type reference. -1700 (n is: 1)"


Initially, I suspected that perhaps some users were running an older Mac system with an old version of Applescript, but the last person to report these errors is running OS X 10.4.8 on an Intel MacBook.

Does anyone have any insights into the cause of these errors, and why they appear on some systems and not on others?

Thanks!

Martin



_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.