我的腳本通過的AppleScript與iPhoto通信時收到此錯誤,我無法重現的用戶:918:955: execution error: iPhoto got an error: "4.294967323E+9Mahabalipuram" doesn’t understand the 「write」 message. (-1708)
神祕AppleScript的錯誤:「4.294967323E + 9Mahabalipuram」不理解「寫」消息
產生錯誤的AppleScript的是:
set nul to character id 0
set text item delimiters to nul
set albumsFile to "/Users/[user]/Downloads/blah.blah"
set fp to open for access (POSIX file albumsFile) with write permission
tell application "iPhoto"
repeat with anAlbum in albums
if anAlbum's type is regular album then
set albumName to anAlbum's name
if albumName is not "Last Import" then
set albumPhotoIds to (id of every photo of anAlbum) as Unicode text
if length of albumPhotoIds is greater than 0 then
set currentAlbum to anAlbum
repeat while currentAlbum's parent exists
set currentAlbum to currentAlbum's parent
set albumName to currentAlbum's name & " > " & albumName
end repeat
set albumId to anAlbum's id
set albumData to {"", albumId, albumName, ""} as Unicode text
write albumData to fp as Unicode text
write albumPhotoIds to fp as Unicode text
write nul to fp as Unicode text
end if
end if
end if
end repeat
end tell
close access fp
沒有人有任何想法,這是怎麼回事錯在這裏?在這個Github問題上有更多的背景:https://github.com/jawj/iphoto-flickr/issues/7
謝謝。這確實有效(或者,等同於將三個寫入放在'告訴我'區塊中),並且比@adayzdone更容易修復(加上它不會在每次循環迭代中打開和關閉文件)。我越來越不是AppleScript粉絲。 – jawj