Member
Join Date: Oct 2009
Location: My Head
|
Hi, I had a few bash lines in GeekTool that displayed the information of the current song playing in iTunes (using osascript), but I accidentally deleted them in some way. Although I'm a C++/Java programmer, I'm not all too familiar with AppleScript, and so I can't get the line of code working again. I swear it was something like the following, and then just inserting "name," "artist," or "album" in the blank, but I can't get it to work.
Code:
osascript -e 'tell application "iTunes" if player state is playing then _____ of current track' If anybody could shed some light on the situation, it'd be much appreciated. |
quote |
‽
|
Code:
osascript -e 'tell application "iTunes" to if player state is playing then get name of current track' |
quote |
‽
|
You were missing a 'to' and a 'get'. The 'get' is probably obvious; the 'to' is easy enough to explain. You can either have a tell block, like so:
Code:
tell application "iTunes"
pause
play
end tell Or, you can have a single command:Code:
tell application "iTunes" to pause |
quote |
Member
Join Date: Oct 2009
Location: My Head
|
Ohhh, I see now. I realized I was missing somewhere where the 'get' is, but I was trying things like output and return, and the 'to' does make sense. Well, at least I gained something out of this. Thanks for the help.
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
iTunes tags script | feidhlim1986 | Genius Bar | 0 | 2008-10-15 20:33 |
Make script launch when iTunes opens? | kieran | Genius Bar | 1 | 2007-08-01 15:40 |
Script Menu in iTunes AWOL | Engine Joe | Genius Bar | 3 | 2006-06-07 06:19 |
iTunes Album Artwork Program/Script | Meltedbutter421 | Third-Party Products | 2 | 2005-08-04 08:21 |
Script? Malware? | BarracksSi | Genius Bar | 7 | 2005-08-03 21:16 |