- Registriert
- 12.11.08
- Beiträge
- 5
liebe leute,
seit längerem suche ich nach einer möglichkeit, einen song in itunes beim 'beenden' (d.h. drücken der pause-taste) nicht abrupt abbrechen, sondern ausfaden zu lassen. nun bin ich nach längerer suche auf ein script gestossen, das dies möglich machen kann. ich habe es als skript gespeichert in library/itunes/scripts, doch wenn ich es danach in itunes aufstarte, meldet mir das programm: "Die Variable InitialVolume ist nicht definiert". Leider kenne ich mich mit script-Schreiben nicht aus, kann mir jemand von euch weiterhelfen? Hier ist der ganze Code des scripts:
tell application "iTunes"
if player state is playing then
-- finish the fade to 0
set initialVolume to sound volume
set currentVolume to sound volume
repeat
if (currentVolume > 0) then
set currentVolume to currentVolume - 1
set sound volume to currentVolume
delay 0.1
else
exit repeat
end if
end repeat
-- figure out whether to pause, or stop for cds
set cdPlaying to false
set currentTrackContainer to (get container of current track)
set numSources to (get index of last source)
-- go through all the sources, and see if its an audio CD and that it is the one playing the current track
repeat with i from 1 to numSources
if (audio CD = (get kind of source i)) and (currentTrackContainer = (get audio CD playlist 1 of source i)) then
set cdPlaying to true
exit repeat
end if
end repeat
if cdPlaying then
stop
else
pause
end if
end if
--return volume to its previous state
set sound volume to initialVolume
end tell
vielen dank schonmal!
urmi
seit längerem suche ich nach einer möglichkeit, einen song in itunes beim 'beenden' (d.h. drücken der pause-taste) nicht abrupt abbrechen, sondern ausfaden zu lassen. nun bin ich nach längerer suche auf ein script gestossen, das dies möglich machen kann. ich habe es als skript gespeichert in library/itunes/scripts, doch wenn ich es danach in itunes aufstarte, meldet mir das programm: "Die Variable InitialVolume ist nicht definiert". Leider kenne ich mich mit script-Schreiben nicht aus, kann mir jemand von euch weiterhelfen? Hier ist der ganze Code des scripts:
tell application "iTunes"
if player state is playing then
-- finish the fade to 0
set initialVolume to sound volume
set currentVolume to sound volume
repeat
if (currentVolume > 0) then
set currentVolume to currentVolume - 1
set sound volume to currentVolume
delay 0.1
else
exit repeat
end if
end repeat
-- figure out whether to pause, or stop for cds
set cdPlaying to false
set currentTrackContainer to (get container of current track)
set numSources to (get index of last source)
-- go through all the sources, and see if its an audio CD and that it is the one playing the current track
repeat with i from 1 to numSources
if (audio CD = (get kind of source i)) and (currentTrackContainer = (get audio CD playlist 1 of source i)) then
set cdPlaying to true
exit repeat
end if
end repeat
if cdPlaying then
stop
else
pause
end if
end if
--return volume to its previous state
set sound volume to initialVolume
end tell
vielen dank schonmal!
urmi