• Medlem
  • Göteborg
  • 2009-04-06 20:18

Hej! Första posten så hoppas jag postar i rätt forum. Kunde inte hitta något Spotify-script till Sofa Control så jag pillade ihop ett själv. Någon kanske är intresserad iaf..

on rcActivate()
	ignoring application responses
		tell the application "Spotify" to activate
	end ignoring
end rcActivate

on rcRight()
	-- Next Song
	simulate keycode 124 for application "com.spotify.client" with command
end rcRight

on rcLeft()
	-- Previous Song
	simulate keycode 123 for application "com.spotify.client" with command
end rcLeft

on rcPlus()
	change sound volume by level 1
end rcPlus

on rcMinus()
	change sound volume by level -1
end rcMinus

on rcPlay()
	-- Play / Pause
	set name_ to name of (info for (path to frontmost application))
	if the name_ is "Spotify.app" then
		simulate keycode 49
	else
		simulate keycode 49 for application "com.spotify.client" with command
	end if
end rcPlay