AMIP Alternative / Now Playing Hotkey

padrak

Aktives Mitglied
Thread Starter
Dabei seit
16.09.2008
Beiträge
145
Reaktionspunkte
6
AMIP Alternative / Now Playing Hotkey (erledigt)

Hallo Forum!

Ich bin auf der Suche nach einem Tool/Skript/o.ä., dass es ermöglicht per Hotkey meinen aktuellen Song mit formatierbarem Inhalt in die Zwischenablage zu kopieren, um dies wieder in einen Chat/Shoutbox einzufügen.

Unter Windows gibt es dafür AMIP, foobar2000 ermöglicht das mittlerweile auch mit Onboardfunktionen.

Auslesbar müssen Interpret, Songtitel, Albumtitel und das Erscheinungsjahr sein.

So sollte es am Ende bsp. aussehen -> /me lauscht: Crippled Black Phoenix - Rise Up And Fight "The Resurrectionist, 2009"

Ist das irgendwie unter iTunes und OSX realisierbar?

Danke im voraus!
 
Zuletzt bearbeitet:
Ist das mit OSX kompatiblen Mitteln echt nicht machbar??

Ich könnte mal versuchen, ob das funzt, wenn ich AMIP per Wine einbinde. Der Datentransfer von foobar (über Wine) in den Chat geht auch problemlos per Hotkey bzw. Tastenkombination.
 
Das interessiert mich auch, ich hab bisher auch noch keine alternative zu AMIP für den Mac gefunden.
 
AMIP per Wine funktioniert bei mir nicht, schade.
 
Scheinbar gibt es da wohl keine Möglichkeiten, wenn hier niemandem etwas einfällt.
 
Tune Buddy ist eigentlich ein feines Tool, man kann es aber - wie vieles für iTunes - überhaupt nicht personaliseren
 
Einfachste Möglichkeit wäre wohl ein in Automator erstellter Dienst der ein AppleScript ausführt, bspw.:

Code:
on run
  try
    tell application "iTunes"
        set songTitle to the name of the current track
	set songArtist to the artist of the current track
	set songAlbum to the album of the current track
	set songYear to the year of the current track
	set the clipboard to songArtist & " - " & songTitle & " \"" & songAlbum & ", " & songYear & "\""
    end tell
 end try
end run

Ergibt bei mir gerade: The National - Bloodbuzz Ohio "High Violet, 2010"

Den Dienst kannst Du in den Tastatureinstellungen ("Tastaturkurzbefehle") mit einem Shortcut belegen. Und natürlich könnte man das AppleScript jetzt noch etwas umfangreicher gestalten, und z.B. in einem Dialog auswählen lassen, welche Informationen genau in die Zwischenablage kopiert werden sollen...
 
Klasse, vielen Dank schon mal.

Ich bin leider ein totaler Neuling, was Applescript angeht. Habe es trotzdem geschafft, dass Script zu erstellen und mit einer Tastenkombination zu belegen.

Allerdings zeigt er mir nie das aktuelle Lied an, sondern immer das davor abgespielte.

Habe deinen Code in einen AppleScript Dienst eingefügt; dann wollte er, dass ich noch das Feld "Text eingeben" hinzufüge(?), was aber anscheinend die Funktion des Scripts nicht beeinträchtigt.

Daraufhin ein Tastaturkürzel an den Dienst gebunden und er zeigt die von di genannte Formatierung an. Nur leider nicht vom aktuellen Lied. Woran könnte das noch liegen?
 
Adium hat doch extra einen Status dafür. ... oder verstehe ich das Anliegen nicht?

Viele Grüße
 
An IM kommt bei mir nur Skype zum Einsatz, daher benötige ich die Songtitelinfos auch als formatierten Text in der Zwischenablage, um diesen dann beliebig per Hotkey einfügen zu können.

EDIT:
Die obige Lösung scheint genau das zu sein, was ich gesucht habe. Nur habe ich das Ganze wohl noch nicht 100% sauber konfiguriert.
 
Zuletzt bearbeitet:
Allerdings zeigt er mir nie das aktuelle Lied an, sondern immer das davor abgespielte.

Wirklich? :confused: Kann ich mir jetzt gerade nicht so ganz erklären. Vielleicht hast Du dem Script keine Zeit zur Ausführung gelassen, und es war noch der vorherige Wert in der Zwischenablage? Gib vielleicht sonst mal alles in den AppleScript-Editor ein, und schau dann, was dort im Event-Log ausgegeben wird.

Habe deinen Code in einen AppleScript Dienst eingefügt; dann wollte er, dass ich noch das Feld "Text eingeben" hinzufüge(?)
Da musst Du nur die Option in Automator ändern:
32ef1d82217d01aee2a96743cdb82584.png


Mit zwei If-Abfragen sieht's übrigens schöner für Songs ohne Album und/oder Jahr aus:
Code:
tell application "iTunes"
	if player state is not stopped then
		
		set aTrack to the current track
		set songTitle to the name of aTrack
		set songArtist to the artist of aTrack
		set songAlbum to the album of aTrack
		set songYear to the year of aTrack
		
		if songYear is not 0 then
			set songYear to ", " & songYear
		else
			set songYear to ""
		end if
		if songAlbum is not "" then
			set albumInfo to " \"" & songAlbum & songYear & "\""
		else
			set albumInfo to ""
		end if
		
		set the clipboard to the songArtist & " - " & the songTitle & the albumInfo
	end if
end tell
 
Das Feld "Dienst empfangen" war wohl der Bösewicht. Jetzt geht alles problemlos. Danke!

Wenn ich der Zwischenablage jetzt noch freien Text hinzufügen möchte, z.B. das o.g. "/me lauscht", wie stelle ich das an?
 
:)

Strings kannst Du dir in AS einfach mit "&" zusammenbauen. Also könntest Du bspw. einfach statt set the clipboard to the songArtist... schreiben: set the clipboard to "/me lauscht " & the songArtist...

Das "the" wird übrigens generell von AS ignoriert und dient nur der Lesbarkeit.
 
Und läuft schon.

Vielen Dank nochmal!

EDIT:
Ich mache mich jetzt selber an die Arbeit, eine Tastenkombination in das Skript zu basteln, damit er die Zwischenablage auch gleich in das gerade aktive Feld einfügt. Learning by doing ;)
 
Zuletzt bearbeitet:
Das vollständige Skript schaut bei mir jetzt so aus:

Code:
on run
    try
        tell application "iTunes"
            set songTitle to the name of the current track
            set songArtist to the artist of the current track
            set songAlbum to the album of the current track
            set songYear to the year of the current track
            set the clipboard to "/me lauscht:" & the songArtist & " - " & songTitle & " \"" & songAlbum & ", " & songYear & "\""
        end tell
    end try
    try
        set the clipboard to Unicode text of (the clipboard as record)
    on error errMsg
        display dialog errMsg
    end try
    tell application "System Events"
        key code 9 using {command down}
    end tell
end run

Fügt das in iTunes abgespielte Lied mit der vorgegebenen Formatierung in das gerade aktive Textfeld ein. Ergo ein vollwertiger AMIP Ersatz. :)
 
Biete folgendes (im RockHard Forum gefunden - die Ausgabe wurde von mir angepasst):

on run
try
tell application "iTunes"
set songTitle to the name of the current track
set songArtist to the artist of the current track
set songAlbum to the album of the current track
set songYear to the year of the current track
set the clipboard to "playing: " & the songArtist & " - " & songTitle & " ††† " & songAlbum & " (" & songYear & ")" & " †††"
end tell
end try
try
set the clipboard to Unicode text of (the clipboard as record)
on error errMsg
display dialog errMsg
end try
tell application "System Events"
key code 9 using {command down}
end tell
end run

Ergibt bei mir aktuell: playing: Mustasch - Angel's Share ††† The New Sound Of The True Best (2011) †††
 
Zurück
Oben Unten