我的脚本通过的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