Dann öffnet er mir das Skript im Editor.
Hier ist mal das Skript "addtoLib"
-- addToLib v 1.1 - An AppleScipt application that adds all files in a given folder to the
-- iTunes Music Library and then (optionally) deletes the files from the source folder
-- Modified from the Add to iTunes Library Desktop Droplet Script by Apple Computer, Inc.
-- Copyright 2004 Ken Barnt <
[email protected]>
-- Change Log
--
-- v 1.0 - original release
-- v 1.1 - fixed bug where sub directories would not be recursed
-- - added support for AAC and Protected AAC files
-- This software is distributed under the Apple Public Source Licence
-- the list of file types which will be processed
-- eg: {"PICT", "JPEG", "GIFf", "TIFF"}
property type_list : {"MPG3", "MIDI", "AIFF", "MPG4"}
-- since file types are optional in Mac OS X,
-- check the name extension if there is no file type
-- NOTE: do not use periods (.) with the items in the name extensions list
-- eg: {"txt", "text", "jpg", "jpeg"}, NOT: {".txt", ".text", ".jpg", ".jpeg"}
property extension_list : {"mp3", "mid", "aif", "m4p", "m4a"}
global counter, playlist_status, this_playlist
on run
-- set the following variable to the path to the folder whose contents
-- you want to add to the iTunes Music Library
set temp_folder to "Festplatte C:Users:Hannes:Music:Mp3s:"
-- set the following variable to 0 or 1 depending on what you want done
-- with the files after they are added to the library
-- 0 - files will be left alone (DEFAULT)
-- 1 - files will be deleted
-- (DO NOT use this option if you DO NOT have the "Copy files to iTunes Music folder
-- when adding to library" option checked in the advanced section of the iTunes
-- preferences)
set del_song to 0
process_folder(temp_folder, del_song)
end run
-- this sub-routine processes folders
on process_folder(this_folder, del_song)
set these_items to list folder this_folder without invisibles
repeat with i from 1 to the count of these_items
set this_item to alias ((this_folder as text) & ":" & (item i of these_items))
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item, del_song)
else if (alias of the item_info is false) and ¬
((the file type of the item_info is in the type_list) or ¬
the name extension of the item_info is in the extension_list) then
process_item(this_item, del_song)
end if
end repeat
end process_folder
-- this sub-routine processes files
on process_item(this_item, del_song)
-- NOTE that the variable this_item is a file reference in alias format
-- FILE PROCESSING STATEMENTS GOES HERE
try
tell application "iTunes"
launch
set this_track to add this_item to playlist "Library" of source "Library"
if the playlist_status is "OK" then
duplicate this_track to this_playlist
end if
end tell
set counter to counter + 1
end try
if del_song is 1 then
tell application "Finder"
delete this_item
end tell
end if
end process_item