property albumPlaylist : "Aktuelles Album"
tell application "iTunes"
activate
-- manage playlist
if not (exists playlist albumPlaylist) then
set this_playlist to make new playlist
set the name of this_playlist to albumPlaylist
end if
delete every track of playlist albumPlaylist
-- get current track
set cur_album to album of current track
set cur_track_nr to track number of current track
if ((count cur_album) is 0) then my showError("This track has no album!")
-- get track numbers of current album
set trackNumbers to track number of tracks of library playlist 1 whose album is cur_album
-- copy all tracks of this album beginning with the current track to new playlist
repeat with trackNumber in trackNumbers
if trackNumber ? cur_track_nr then
duplicate (first track of library playlist 1 whose album is cur_album and track number is trackNumber) to playlist albumPlaylist
end if
end repeat
-- get player position
set player_position to player position
-- activate playlist
set view of browser window 1 to playlist albumPlaylist
play first track of playlist albumPlaylist
end tell
on showError(msg)
tell application (path to frontmost application as Unicode text)
display dialog msg buttons "Cancel" default button 1 with icon stop
end tell
error number -128
end showError