fik en til at lave den her kode.
(*
--
-- Album Name from Folder Name script
-- copyright 2008 by S2_mac;
-- issued under the "MIT License" (
http://www.opensource.org/licenses/mit-license.php);
-- if something screws up, don't come looking to the author for redress
--
STEP ZERO: save a copy of the "iTunes Library" file located at ~/Music/iTunes/iTunes Library
= = = = = = = = = = = = = = = = = = = = = = = = = =
1) BEFORE adding files, set iTunes prefs to NOT copy files to iTunes Music &
to NOT keep iTunes Music organized
2) COPY only a few folders to their desired destination (including iTunes Music folder);
no more than 100 tracks or so
3) ADD those few folders to iTunes
4) SORT the "Music" list by Date Added
5) SELECT the just-added tracks that have no Album tag and choose
"New Playlist from Selection" from File menu; name the new playlist
6) DISPLAY the new playlist and sort it by PLAY ORDER (the leftmost column,
showing play order numbers); select all tracks
7) RUN the script
8) EXAMINE the results closely...
9) DO IT ALL AGAIN, adding up to a couple thousand tracks
= = = = = = = = = = = = = = = = = = = = = = = = = =
*)
tell application "iTunes"
set sel to a reference to selection of front browser window
if contents of sel is {} then
display dialog "Select some tracks!" buttons {"Cancel"}
end if
set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
with timeout of 30000 seconds
repeat with a_track in sel
tell a_track
set the_path to location
if the_path is not missing value then set album to (text item -2 of (the_path as string))
end tell
end repeat
end timeout
set AppleScript's text item delimiters to TID
display dialog "Done!" buttons {"Thanks"} default button 1 giving up after 5
end tell