iTunes / url aufruf bei Songwechsel

thebug

thebug

Aktives Mitglied
Thread Starter
Dabei seit
15.03.2004
Beiträge
518
Reaktionspunkte
31
Guten Abend liebe MU Comunity..

Ich habe leider bisher keine Lösung für mein "Problem" gefunden und wende mich deshalb ein euch... :D

Ich suche ein script für iTunes welches bei liedwechsel, bzw wenn ein lied vobei ist eine url aufruft und an diese interpret und songname dranhängt...

Leider habe ich absolut keine Ahnung wie man so etwas programmiert....

thx

Leon
 
Kann ich zwar auch nicht, aber es würde mich interessieren was du damit bezweckst.

(hab auch lieb für dich gevotet:D)
 
es geht um ein forum (nicht meins aber von freunden [http://www.rösrather-krempel.de]) in dem alle recht musikbegeistert sind...Nun hat der tolle Webmaster was gebaut das man (allerdings nur wenn man winamp besitzt) immer das zuletzt gehörte lied in der signatur hat....und ich find das garnicht ok das das den winamp usern vorbehalten ist :D

deshlab brauche ich obengenanntes für iTunes... :)
 
Geil :D

Könnten wir das bitte auch bei uns einführen?

*fünfmal Unterschreib*
 
ich denke das das bei einer so großen comunity schnell zu serverproblemen führen würde!? ;)
 
danke...ABER :) wenn dich das richtig verstanden hab, läd der trackReporter eine vorher generierte datei auf einen server....ich aber brauche ein script welches einfach eine url aufruft und an diese titel und interpret dranhängt...das restlich passiert dann auf dem server mittels php...

thx

leon
 
weiß keiner was? Müsste doch ein leichtes für ein paar hier sein sowas zu proggen...einfach bei liedwechsel "unsichtbar" url+interpret+%20+-+%20+titel aufrufen....hab leider nichts gefunden...und ich hab schon was länger gesucht ^^
 
hmm...hat denn wer ein paar ansätze für mich?
hab noch nie was mit applescript gemacht....

bin für jede hilfe dankbar...

leon
 
ok, da mit ja keiner helfen will/kann ;)
hab ich es selber versucht...erstmal überhaupt den songnamen und interpret rausfinden und an die url hängen..
doch noch nicht mal das klappt...deshalb: was ist falsch? :D

Code:
tell application "iTunes"
	activate
	
	set this_track to current track
	set this_name to the name of this_track
	set this_artist to the artist of this_track
	set this_album to the album of this_track
	
end tell
property target_URL : "http://www.meineseite.de/musik.php?" & this_artist & "%20-%20" & this_name
open location target_URL


wie gesagt..ist das erstemal das ich etwas mit applescript mache...

leon
 
...

Hallo thebug,

also Ansatz hattest Du doch mit dem Skript oder nicht?
Vom Format wie das an die Website übertragen werden soll stand nichts in Deinem Beitrag. Mal davon abgesehen, dass das nicht das AppleScript Forum ist...

tell application "iTunes"
-- activate -- würde iTunes in den Vordergrund holen

-- set this_track to current track --?
set this_name to name of current track
set this_artist to artist of current track
set this_album to album of current track
end tell
set target_URL to "http://www.meineseite.de/musik.php?" & this_artist & " - " & this_name $ this_album as string
open location target_URL -- holt jetzt mal Safari in den Vordergrund aber zum Testen reichts vorerst ;)

Bei copy/paste gibt es eventuell Fehler mit Leerzeichen.


Gruß Andi
 
Zuletzt bearbeitet:
ok, bin was weitergekommen...

Code:
tell application "iTunes"
	set this_track to current track
	set this_name to the name of this_track as string
	set this_artist to the artist of this_track
	set this_album to the album of this_track
	set target_URL to "http://www.meineseite.tk/musik.php?" & this_artist
end tell
open location target_URL

wenn ich das richtig sehe muss ich die variablen von leerzeichen befreien, bzw durch "%20" ersetzen...nur wie mache ich das?

leon
 
...

Hallo the_bug,

ersetzt nicht Safari die Leerzeichen automatisch?
set target_URL to "http://www.meineseite.de/musik.php?" & this_artist & " - " & this_name & " - " & this_album as string -- fehlte noch der Strich nach name

Gruß Andi
 
Zuletzt bearbeitet:
hab das bis jetzt nur mit
set target_URL to "http://www.meineseite.tk/musik.php?" & this_artist

ausprobiert und das ging komischerweise nur wenn im artist namen keine leerstellen vorkamen...hmm... :rolleyes:
 
ok bin was weiter und schlauer :D

Code:
tell application "iTunes"
	set this_track to current track
	set this_name to the name of this_track
	set this_artist to the artist of this_track
	set this_album to the album of this_track
	set target_URL to "http://www.deomain.de/musik.php?song=" & this_artist & "%20-%20" & this_name
end tell
open location target_URL

das funktioniert super...aber leider nur wenn weder Interpret noch titel leerzeichen enthalten....und das ist sehr doof da die meisten lieder aus 2 und mehr wörtern bestehen........und ich hab keine idee wie ich das ganze so automatisiere das das immer duchläuft soblad itunes einen song weiter geht....
 
Code:
tell application "iTunes"
	ignoring case
		set this_track to current track
		set this_name to the name of this_track
		set this_artist to the artist of this_track
		set this_album to the album of this_track
		
		
		
	end ignoring
	
	set target_URL to "http://www.deomain.de/musik.php?song=" & this_artist & "%20-%20" & this_name
end tell


set theAppendChars to "%20" --> The string to add after the consonants 
set theQueryList to " "

set theInput to target_URL
set theOutput to ""

ignoring case
	repeat with theIndex from 1 to (count theInput)
		set tmpChar to (character theIndex of theInput)
		set theOutput to (theOutput & tmpChar)
		
		if theQueryList contains tmpChar then
			set theOutput to (theOutput & theAppendChars)
		end if
	end repeat
end ignoring




return theOutput
open location theOutput

ich weiß...is was zusammen gestückelt...aber der feinschliff kommt später..also mein problem jetzt ist folgendes...er fügt %20 zeichen an die leerzeichen anstatt diese zu ersetzen... :mad:
 
Code:
tell application "iTunes"
	set this_track to current track
	set this_name to the name of current track
	set this_artist to the artist of current track
	
	set target_URL to "http://www.domainl.de/tbb/listening.php?user_id=7&song=" & this_artist & "%20-%20" & this_name
	
	tell application "Safari"
		open location target_URL
		close window 1
	end tell
end tell

das funzt schon super...jetzt fehlt aber noch eine event abfrage...also das das script ausgeführt wird wenn ein lied startet bzw aufhört---jemand ne idee?
#
danke

leon
 
Zurück
Oben Unten