试图通过iTunes中的Applescript向电视节目添加插曲ID

试图通过iTunes中的Applescript向电视节目添加插曲ID,applescript,itunes,Applescript,Itunes,我有以下代码: tell application "iTunes" repeat with thetrack in tracks of playlist "foo" set showName to name of thetrack set showName to ((characters 17 through -1 of showName) as string) set episode ID of thetrack to name of thetrack end repe

我有以下代码:

tell application "iTunes"
repeat with thetrack in tracks of playlist "foo"
    set showName to name of thetrack
    set showName to ((characters 17 through -1 of showName) as string)
    set episode ID of thetrack to name of thetrack
end repeat
end tell
我正在尝试将电视节目的插曲ID设置为曲目名称。如果我注释掉set-eposion-ID行,showName将被明确设置为正确的字符串。但是,当我尝试实际设置插曲ID时,会出现以下错误:

iTunes出现错误:无法将播放列表“Fitness&Nutrition”的每首曲目的项目1的插曲ID设置为播放列表“Fitness&Nutrition”的每首曲目的项目1的名称

我承认,我被难住了。

试试:

set episode ID of thetrack to (name of thetrack as text)
因为

return class of name of thetrack --> property

return class of (name of thetrack as text) --> text