使用Applescript获取Bento中库的名称

时间:2011-07-10 23:06:57

标签: applescript

我很难开始使用Applescript和Bento。最初我想获取库的名称,我正在尝试使用以下脚本:

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和Bento。

1 个答案:

答案 0 :(得分:0)

原来这是我在使用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