1

我正在尝试编写一个脚本,它可以让我根据曲目的标题将专辑的一个版本的播放计数复制到另一个版本。

基本上,情况是我的电脑上有专辑以及所有播放次数。然后我以更高的质量重新翻录原始 CD(以前我的质量偏好非常低)。

现在我想自动将我旧的糟糕质量撕裂的播放次数复制到新的高质量撕裂中。

我采用了 Doug Adams 的脚本来尝试执行此操作,但是当我尝试运行它时,它只会给我“发生描述符类型不匹配”。没有任何迹象表明问题所在的行。

我以前从未使用过 Apple Script;有人知道问题出在哪里吗?

global thismany
tell application "iTunes"
    if selection is not {} then
        set sel to selection
        repeat with t in sel
            set t to contents of t
            if class of t is file track or class of t is URL track then
                if played count of t is 0 then
                    set thismany to 0
                    repeat with t2 in sel
                        set t2 to contents of t2
                        if class of t2 is file track or class of t2 is URL track then
                            if title of t is equal to title of t2 and t2 is not t then
                                set thismany to played count of t2
                                exit repeat
                            end if
                        end if
                    end repeat
                    set played count of t to (thismany as integer)
                    if (thismany as integer) is 0 then
                        try
                            set played date of t to missing value
                        end try
                    end if
                end if
            end if
        end repeat
    else -- no track selected
        tell me to message_and_cancel("No tracks selected.")
    end if
end tell
4

1 回答 1

0

我想通了,原来问题是没有轨道的 atitle之类的东西,该属性称为name轨道的。

如果有人感兴趣,现在可以在这里找到完整的脚本。

于 2013-05-19T10:55:34.987 回答