0

我是 appplescript 和一般编程的新手。有人会那么好心地查看我的代码吗?我知道它还不是正确的 applescript 语法,因为我很难找到该信息。

tell application iTunes
for each track in library playlist{ #all listed tracks, regardless of what files i have.  may include dead links
set tr to track name
if file location is missing then search for it at external/Music/iTunes else messagebox(tr no file)
if search has result cut and paste to Music/itunes
check if file now exists else messagebox(tr error)
} end tell
4

1 回答 1

0

我会让你开始。以下是如何找到计算机上未找到的所有曲目的歌曲名称和艺术家的方法。您必须在此基础上完成其余的工作。

set missingTracks to {}
tell application "iTunes"
    set alltracks to tracks of library playlist 1
    repeat with aTrack in alltracks
        set theLocation to location of aTrack
        set doesExist to my fileExists(theLocation)

        if not doesExist then
            set thisInfo to {songName:name of aTrack, songArtist:artist of aTrack}
            set end of missingTracks to thisInfo
        end if
    end repeat
end tell
return missingTracks


on fileExists(theLocation)
    tell application "Finder"
        if exists theLocation then
            return true
        else
            return false
        end if
    end tell
end fileExists
于 2015-01-14T16:56:09.057 回答