Created
March 17, 2013 01:08
-
-
Save dulichan/5179088 to your computer and use it in GitHub Desktop.
A small script to tweet the now listening song
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "iTunes" | |
if player state is playing then | |
set myTrack to current track | |
copy name of myTrack to nameOfTrack | |
copy artist of myTrack to artistOfTrack | |
tell application "System Events" | |
tell process "Notification Center" | |
click menu bar item 1 of menu bar 1 | |
click button 1 of UI element 1 of row 2 of table 1 of scroll area 1 of window "window" | |
#display dialog nameOfTrack | |
keystroke "Now listening to " & nameOfTrack & " by " & artistOfTrack & " #nowListening" | |
keystroke "D" using {command down, shift down} | |
keystroke space | |
end tell | |
end tell | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment