使用Applescript获取Bento中库的名称

使用Applescript获取Bento中库的名称,applescript,Applescript,我正在努力使用Applescript和便当。最初,我希望获得库的名称,并尝试使用以下脚本: tell application "Bento" repeat with i from 1 to count of libraries tell library i try set theName to name of library i log theName end try end tell end rep

我正在努力使用Applescript和便当。最初,我希望获得库的名称,并尝试使用以下脚本:

tell application "Bento"
repeat with i from 1 to count of libraries
    tell library i
        try
            set theName to name of library i
            log theName
        end try
    end tell
end repeat
end tell
典型的错误消息为:

    get name of library 1 of library 1
    --> error number -1728 from «class GLib» 1 of «class GLib» 1

谁能给我指点一下正确的方向,让我开始用Applescript和便当吗

原来是我在使用Applescript时出错了:

tell application "Bento"
repeat with i from 1 to count of libraries
    set theName to name of library i
    log theName
end repeat
end tell