iTunes - Track ab bestimmter Position per AS starten

muetze

muetze

Mitglied
Thread Starter
Dabei seit
11.11.2005
Beiträge
56
Reaktionspunkte
0
Hi,

wie kann ich einen Track per AS ab einer bestimmten Position starten (vorher mit "player position" ermittelt).

muetze
 
Rechtsklick => Einstellungen => Optionen => Starten bei:

Aber was ist AS???

'AeinStellungen'??? :D
 
uups - sorry - AS = AppleScript.

muetze

PS Ich glaub, ich bin aus Versehen im falschen Forum gelandet - ich wollte ins AS-Forum.
Kann man den Tread verschieben?
 
Hi muetze,
erzähl' mal, warum du das machen möchtest. Interessiert mich. Und was das Script genau machen sollte...
LG
 
Wenn gerade irgendein Track gespielt wird, möchte ich alle Tracks ab dem aktuellen Track (inklusive) dieses Albums in eine neue Playlist kopieren (das klappt schon mit der Adaption einiger Scripte von Doug) und das Abspielen das aktuellen Titels nicht von vorn, sondern von seiner vorherigen Position fortsetzen. Dass es dabei zu einem Sprung kommt, ist mir klar (er sollte aber klein sein).

Code:
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

muetze
 
muetze schrieb:
...und das Abspielen das aktuellen Titels nicht von vorn, sondern von seiner vorherigen Position fortsetzen.
Okay - kennst du die Funktion "Position merken"? Alle Titel in der Bibliothek markieren, mit Apfel+I Infofenster aufrufen und unten links für alle Titel "Position merken" auf "Ja" stellen - bestätigen. Danach beginnt jedes Stück immer von der Position, wo es irgendwann gestoppt wurde. Das müsste ja dann mit deinem Script auch funktionieren.
LG
 
Das will ich zwar nicht dauerhaft anstellen, kann ich aber vielleicht für das Script verwenden (anschalten und wieder ausschalten).

Danke muetze

PS meine eigentliche Frage bleibt bestehen.
 
Code:
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 bookmarkable of current track to true
	
	-- activate playlist
	set view of browser window 1 to playlist albumPlaylist
	play first track of playlist albumPlaylist
	set bookmarkable of current track to false
	
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

Funktioniert - die Eigenschaft ist "bookmarkable" - es gibt nur einen kurzen Aussetzer. Super - vielen Dank.

muetze
 
Unglaublich, was alles möglich ist, gell...:D
Enjoy the music!
LG
 
Zurück
Oben Unten