Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Copy "Artist - Song name" to the clipboard

The aim is to assign a shortcut for copying the artist and name of currently playing or selected song from iTunes to the clipboard.

How it can be done?

MacBook Pro, OS X Mountain Lion (10.8.2)

Posted on Apr 20, 2013 1:05 AM

Reply
Question marked as Best reply

Posted on Apr 20, 2013 9:38 AM

I usually recommend not manipulating the clipboard via AppleScript - not because it can't be done (it can), but because there are usually better options.


In any case, since I don't know what you're ultimately trying to do...


tell application "iTunes"

if player state is playing then

set TA to artist of (get current track)

set TN to name of (get current track)


set the clipboard toTA & " - " & TN

end if

end tell


The issue is assigning this to a key shortcut, which AppleScript can't do on its own.

5 replies
Question marked as Best reply

Apr 20, 2013 9:38 AM in response to Uproooar

I usually recommend not manipulating the clipboard via AppleScript - not because it can't be done (it can), but because there are usually better options.


In any case, since I don't know what you're ultimately trying to do...


tell application "iTunes"

if player state is playing then

set TA to artist of (get current track)

set TN to name of (get current track)


set the clipboard toTA & " - " & TN

end if

end tell


The issue is assigning this to a key shortcut, which AppleScript can't do on its own.

Apr 22, 2013 7:32 AM in response to Camelot

Case #1 – Copy current track's "Artist Name - Track Title" to the clipboard by pressing shortcut.


Applescript + FastScripts do it but I don't want an extra app in Login Items.


Case #2 – Copy selected tracks' "Artist Name - Track Title" to the clipboard by pressing shortcut.



That's what I have in clipboard after pressing cmd + c (unnecessary info: album, duration, etc.)

User uploaded file


Thats what I want in clipboard after pressing shortcut (e.g., alt + c or cmd + c if possible)

User uploaded file

Copy "Artist - Song name" to the clipboard

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.