Applescript编辑器没有响应

Applescript编辑器没有响应,applescript,itunes,itunesartwork,Applescript,Itunes,Itunesartwork,为了确定itunes中没有艺术作品的歌曲,我做了以下脚本。它是基于我在网上找到的其他脚本 tell application "iTunes" repeat with a in every track of playlist "Library" if not (exists (artwork 1 of a)) then add (get location of a) to (playlist "noart") end if end repeat

为了确定itunes中没有艺术作品的歌曲,我做了以下脚本。它是基于我在网上找到的其他脚本

tell application "iTunes"
   repeat with a in every track of playlist "Library"
      if not (exists (artwork 1 of a)) then
         add (get location of a) to (playlist "noart")
      end if
   end repeat
end tell
它似乎工作正常,编译良好,因为我可以在事件日志窗口中看到它:

tell application "iTunes"
    count every track of playlist "Library"
        --> 10684
    exists artwork 1 of item 1 of every track of playlist "Library"
        --> true
    exists artwork 1 of item 2 of every track of playlist "Library"
        --> true
但在400首曲目之后,它开始缓慢运行,而applescript在1000首曲目之后停止响应

我想我可能会耗尽我的mac内存,但在Activity Monitor中,我可以看到Applescript消耗了100%的CPU和不到50MB的内存。我在MacBookPro上运行macos 10.7.4(i7带有4GB内存)

正如你所看到的,我的itunes库有10684首曲目。这不是一个小图书馆,但也不是一个大图书馆

有人有什么建议吗?或者一个脚本来识别没有艺术作品的曲目

蒂亚


鲍勃,这是我用的。我的主要建议是使用“复制”而不是“添加”,这样您就不需要获得轨迹的位置。你也会看到我使用了“引用”大多数东西,这使它工作得更快。我还创建了带有时间戳的“无艺术作品”播放列表,以便在运行脚本时查看

set d to current date
set missingTracksCount to 0
tell application "iTunes"
    set isFixedIndexing to fixed indexing
    if not isFixedIndexing then set fixed indexing to true

    -- make a new playlist to hold the tracks
    set newPlaylist to make new playlist
    set name of newPlaylist to "No Art - " & month of d & " " & day of d & " " & time string of d

    set mainPlaylist to a reference to playlist "Library"
    set noArtworkPlaylist to a reference to newPlaylist

    set trackCount to count of tracks of mainPlaylist
    repeat with i from 1 to trackCount
        set trackRef to (a reference to (track i of mainPlaylist))
        if (count of artworks of trackRef) is less than 1 then
            duplicate trackRef to noArtworkPlaylist
            set missingTracksCount to missingTracksCount + 1
        end if
    end repeat

    if not isFixedIndexing then set fixed indexing to isFixedIndexing

    display dialog "Finished!" & return & (missingTracksCount as text) & " tracks didn't have artwork." buttons {"OK"} default button 1 with icon note giving up after 5
end tell

信息:当你遍历一个长列表时,不要使用“事件日志窗口”,因为如果“事件日志窗口”中的字符数太多,“Applescript编辑器”将不会响应。它在30秒内扫描了我的库。。。我将尝试在onder中更改脚本,以确定哪一行保存了它。