재생 목록의 트랙을 반복하는 스크립트가 있습니다. 이미 mp3 인 경우 iPod에 추가 (duplicate currentTrack to ipod_lib
)하고 재생 목록에서 삭제합니다.이 부분은 정상적으로 작동합니다. 그러나 무손실 인 경우 mp3로 변환하여 iPod에 추가하려고합니다. 크기가 너무 크기 때문에 무손실 파일을 직접 추가하지 않아도됩니다. duplicate convertedTrack to ipod_lib
다음과 같은 오류가 발생합니다 라인 ...iTunes에서 변환 된 트랙 사용하기 AppleScript
오류 "iTunes가있어 오류 :에 소스 ID 235166의 라이브러리 재생 목록 ID 270897를 설정할 수 없습니다 {소스 ID의 라이브러리 재생 목록 ID 38702의 파일 트랙 ID 322339 68} . " locateiPods
코드가 http://dougscripts.com/
에서 스크립트에서 가져 235166
소스 ID의 라이브러리 재생 목록 ID 270897에서 번호 -10006 정말 내가 ... 여기에 잘못하고 있어요하지 않도록 어떤
on locateiPods()
set the volumes_directory to "/Volumes/" as POSIX file as alias
set the volume_names to list folder volumes_directory without invisibles
set mounted_iPods to {}
repeat with i from 1 to the count of volume_names
try
set this_name to item i of volume_names
set this_disk to ("/Volumes/" & this_name & "/") as POSIX file as alias
set these_items to list folder this_disk
if "iPod_Control" is in these_items then
set the end of the mounted_iPods to this_disk
end if
end try
end repeat
-- check for iPod count
if the mounted_iPods is {} then
--
try
display dialog "iPod is not mounted." buttons {"Cancel"} with icon 0 giving up after 15
on error
error number -128
end try
else if the (count of the mounted_iPods) is greater than 1 then
-- choose iPod
set the ipod_names to {}
repeat with i from 1 to the count of the mounted_iPods
set this_iPod to item i of the mounted_iPods
tell application "Finder"
set the end of the ipod_names to the name of this_iPod
end tell
end repeat
tell application "iTunes"
activate
set this_name to (choose from list ipod_names with prompt "Pick the iPod to use:") as string
end tell
if this_name is "false" then error number -128
repeat with i from 1 to the count of the ipod_names
if item i of the ipod_names is this_name then
set this_iPod to item i of the mounted_iPods
exit repeat
end if
end repeat
else
set this_iPod to item 1 of the mounted_iPods
end if
return this_iPod
end locateiPods
tell application "iTunes"
set allTracks to every track in user playlist "TEST"
set the_iPod to my locateiPods() -- this is a path
set the_iPod_name to text 1 thru -2 of (the_iPod as string)
set ipod_src to some source whose name is the_iPod_name
set ipod_lib to library playlist 1 of ipod_src
repeat with i from 1 to count of allTracks
set currentTrack to item i of allTracks
set fileType to kind of currentTrack as string
if fileType is "MPEG audio file" then
duplicate currentTrack to ipod_lib
tell playlist "TEST" to delete contents of currentTrack
end if
if fileType is "Apple Lossless audio file" then
set convertedTrack to convert currentTrack
duplicate convertedTrack to ipod_lib
end if
end repeat
end tell
다음과 같이하면 convertedTrack
이 track
이 아니란 것을 알 수 있습니다.