FasdUAS 1.101.10 k l MG A nice applescript for displaying what's playing in iTunes as follows:  A nice applescript for displaying what's playing in iTunes as follows: l  l  Song by Artist on Album0 Song by Artist on Album  l # (# Stars) 00:00/00:00 # of #: (# Stars) 00:00/00:00 # of # l l RL You can use the script for whatever you want, I'd recommend using Geektool. You can use the script for whatever you want, I'd recommend using Geektool. l  XR Applescript by Andrew Harrison andrew@harrison.org http://andrew.harrison.org !! Applescript by Andrew Harrison "andrew@harrison.org " http://andrew.harrison.org"# "l$% $E? with some parts from Doug's Applescript for iTunes. see below.%&&~ with some parts from Doug's Applescript for iTunes. see below.#'( 'l)* )ZT in Geektool: osascript "/Users/ah/Documents/Documents etc/applescripts/itunes.scpt"*++ in Geektool: osascript "/Users/ah/Documents/Documents etc/applescripts/itunes.scpt"(,- ,l-./ .l01 0E? First things first, we're going to check if iTunes is running:122~ First things first, we're going to check if iTunes is running:/3 3l4 4O56 5Z78 7E 9: 9n ;< ;1  pnam <2  prcs :m ==>> iTunes 8k??@A @lABC BlDE DD> Now we know it's running, let's see if it's playing anything:EFF| Now we know it's running, let's see if it's playing anything:CG GOHI HZJK J=LM L1  pPlS Mm  ePlSkPSP KkNNOP OlQR QC= If it's playing, let's get all the info we're going to need:RSSz If it's playing, let's get all the info we're going to need:PTU TlVW V Get Track TitleWXX Get Track TitleUYZ Yr![\ [n]^ ]1  pnam ^1  pTrk \o 0 currtrackZ_` _l""`ab al""cd c Get Track Artistdee" Get Track Artistbfg fr")hi hn"'jk j1%'  pArt k1"%  pTrk io 0 currartistglm ll**mno nl**pq p Get Track Albumqrr Get Track Albumost sr*1uv un*/wx w1-/  pAlb x1*-  pTrk vo 0 curralbumtyz yl22z{| {l22}~ } Get Track Rating~" Get Track Rating| r2A I2= .sysorondlong doub ^29 l27 n27 157  pRte 125  pTrk m78 o 0currrate lBB lBB  Get Track Position& Get Track Position rBK 1BG  pPos o 0timevaltimeVal lLL lLL YS player position returns number of seconds, so let's make it hours/minutes/seconds. player position returns number of seconds, so let's make it hours/minutes/seconds. lLL NH the seconds -> hh:mm:ss script is from Doug's Applescripts for iTunes  the seconds -> hh:mm:ss script is from Doug's Applescripts for iTunes  lLL RL (http://dougscripts.com/itunes/scripts/scripts02.php?page=3#replaylastbit)  (http://dougscripts.com/itunes/scripts/scripts02.php?page=3#replaylastbit)  lLL )# I found the script via iPodLounge.F I found the script via iPodLounge. rLW lLS _LS oLO 0timevaltimeVal 1OR  hour o 0numhoursnumHours rXg \Xc oX[ 0timevaltimeVal l[b ][b o[^ 0numhoursnumHours 1^a  hour o 0timevaltimeVal rhs lho _ho ohk 0timevaltimeVal 1kn  min  o 0 numminutes numMinutes rt \t otw 0timevaltimeVal lw~ ]w~ owz 0 numminutes numMinutes 1z}  min  o 0 numseconds numSeconds l l ! build a zero-padded string6 build a zero-padded string r c m m  TEXT o 0timestrtimeStr l l <6 format the hours. only show if time is 1 hour or morel format the hours. only show if time is 1 hour or more l @: the if > 0 part was added by me for greater functionalityt the if > 0 part was added by me for greater functionality Z l ? o 0numhoursnumHours m k Z l A o 0numhoursnumHours m  r m0 o 0timestrtimeStr r l b o 0timestrtimeStr o 0numhoursnumHours o 0timestrtimeStr~ r l}| b o{ {0timestrtimeStr m:}| oz z0timestrtimeStr~ lyxwyxw    lv  v   format the minutes & format the minutes  Zut lsr A oq q0 numminutes numMinutes mpp sr r lon b om m0timestrtimeStr m0on ol l0timestrtimeStrut r l!kj !b"# "oi i0timestrtimeStr #oh h0 numminutes numMinuteskj  og g0timestrtimeStr$% $lfedfed%&' &lc()c ( format the seconds)**& format the seconds'+, +r-. -l/ba /b01 0o` `0timestrtimeStr 1m2233:ba .o_ _0timestrtimeStr,45 4Z67^] 6l8\[ 8A9: 9oZ Z0 numseconds numSeconds :mYY \[ 7r;< ;l =XW =b >? >o V V0timestrtimeStr ?m  @@AA0XW <oU U0timestrtimeStr^]5BC Br!DE DlFTS FbGH GoR R0timestrtimeStr HoQ Q0 numseconds numSecondsTS EoP P0timestrtimeStrCIJ Il""ONMONMJKL Kl""LMNL M thanks Doug!NOO thanks Doug!LPQ Pl""KJIKJIQRS Rl""HGFHGFSTU Tl""EVWE VIC Now, we have all the info, so let's get some output happening hereWXX Now, we have all the info, so let's get some output happening hereUYZ Yl""DCBDCBZ[\ [l""A]^A ]D> First, let's make a string called title info, that looks like^__| First, let's make a string called title info, that looks like\`a `l""@bc@ b Track by Artist on Albumcdd2 Track by Artist on Albumaef er"3gh gl"/i?> ib"/jk jb"-lm lb")no nb"'pq po"#= = 0 currtrack qm#&rrss by oo'(< <0 currartist mm),ttuu on ko-.; ; 0 curralbum?> ho: : 0 titleinfofvw vl44987987wxy xl446z{6 z@: We've set up a nice box in Geektool that fits between the{||t We've set up a nice box in Geektool that fits between they}~ }l4455 >8 corner of the screen and the edge of the dock. we don'tp corner of the screen and the edge of the dock. we don't~ l4444 C= want the text to wrap to the next line, because that's ugly.z want the text to wrap to the next line, because that's ugly. l4433 D> Geek tool can automatically cut it off, but that's also ugly.| Geek tool can automatically cut it off, but that's also ugly. l44210210 l44// D> Instead, let's cut it off at a certain point if it's too long| Instead, let's cut it off at a certain point if it's too long l44.. B< and replace the last few characters with an ellipsis, whichx and replace the last few characters with an ellipsis, which l44-- E? looks much prettier. 54 is the gap for my dock, you might need~ looks much prettier. 54 is the gap for my dock, you might need l44,, E? to change it for a higher/lower resolution or if you have more~ to change it for a higher/lower resolution or if you have more l44++ D> in your dock than i do. Also, I recommend using a fixed-width| in your dock than i do. Also, I recommend using a fixed-width l44** .( font [i use Monaco] so it's consistent.P font [i use Monaco] so it's consistent. Z4c)( ?4? n4; 17;' ' leng o47& & 0 titleinfo m;>%%7 rB_ cB[ bBW nBS 7ES$ $ cha mKM## mNR""7 oBE! ! 0 titleinfo mSV... mWZ  ctxt o  0 titleinfo)( ldd ldd ldd @: next, we'll make a string called trackinfo, which will bet next, we'll make a string called trackinfo, which will be ldd =7 the length, rating and track number of what's playing.n the length, rating and track number of what's playing. ldd -' first, get the total time of the trackN first, get the total time of the track rdo ndk 1gk  pTim 1dg  pTrk o  0 timetotal lpp lpp B< if the total time is less than 5 digits [four plus a colon]x if the total time is less than 5 digits [four plus a colon] lpp HB add a 0 to the front so it's the same format as the current time. add a 0 to the front so it's the same format as the current time. Zp Ap{ npw 1sw  leng ops 0 timetotal mwz   r~ b~ m~0 o  0 timetotal o  0 timetotal   l l GA then, get the track number in the playlist of whatever's playing then, get the track number in the playlist of whatever's playing r n 1  pidx 1  pTrk o 0 tracksleft l l <6 then count the total number of tracks in the playlistl then count the total number of tracks in the playlist r   I .corecnte********  n   2  cTrk  1  pPla  o 0 trackstotal l l # and output it all like such:: and output it all like such: l $ (# stars) 00:00/00:00, # of #< (# stars) 00:00/00:00, # of # r b b !  b"# "b$% $b&' &b() (b*+ *b,- ,b./ .m0011( /o 0currrate -m2233 stars) +o 0timestrtimeStr )m4455/ 'o 0 timetotal %m6677, #o 0 tracksleft !m8899 of o 0 trackstotal o 0timeinfo:; :l;<= <l=>? >l@A @D> because we have growltunes running, and it pops up with that ABB| because we have growltunes running, and it pops up with that ?CD ClEF EC= music video thing at the beginning of each song, we're goingFGGz music video thing at the beginning of each song, we're goingDHI HlJK JC= to make the output blank for the first 5 seconds of the songKLLz to make the output blank for the first 5 seconds of the songIMN MlOP O:4 because it would be block by the growl thing anywayPQQh because it would be block by the growl thing anywayNR RZSTU SAVW V1  pPos Wm TrXY XmZZ[[ Yo 0output Uk\\]^ ]l^_` _l`ab alcd cJD for the rest of the song, though, we want the output to be all the dee for the rest of the song, though, we want the output to be all the bfg flhi hE? stuff we've already organised. it will be formatted like this:ijj~ stuff we've already organised. it will be formatted like this:gkl klmn m1+ Song by Artist on Album [line break: "/r"]nooV Song by Artist on Album [line break: "/r"]lpq plrs r$ (# stars) 00:00/00:00, # of #stt< (# stars) 00:00/00:00, # of #quv ulwx wLF if we set up geektool to update this once a second, the first counterxyy if we set up geektool to update this once a second, the first countervz{ zl|} | will go up each second.}~~0 will go up each second.{ r b b o 0 titleinfo m o 0timeinfo o 0output Imhookalis@MegatronÐH+K iTunes.app;nWT Applications[VK Megatron:Applications:iTunes.app iTunes.appMegatronApplications/iTunes.app/ 6msevsalisMegatronÐH+ System Events.apppD, CoreServices[  6Megatron:System:Library:CoreServices:System Events.app$System Events.appMegatron-System/Library/CoreServices/System Events.app/ .aevtoappnull**** 0 currtrack 0 currartist 0 curralbum 0currrate 0timevaltimeVal 0numhoursnumHours 0 numminutes numMinutes 0 numseconds numSeconds 0timestrtimeStr 0 titleinfo 0 timetotal 0 tracksleft 0 trackstotal 0timeinfo 0output .aevtoappnull**** k3==2@rt02468Z  prcs  pnam  pPlS  ePlSkPSP  pTrk 0 currtrack  pArt 0 currartist  pAlb 0 curralbum  pRte .sysorondlong doub 0currrate  pPos 0timevaltimeVal  hour 0numhoursnumHours  min 0 numminutes numMinutes 0 numseconds numSeconds  TEXT 0timestrtimeStr 0 titleinfo  leng7  cha  ctxt  pTim 0 timetotal  pidx 0 tracksleft  pPla  cTrk .corecnte******** 0 trackstotal 0timeinfo 0output*-,*,*,,EO*,,EO*,,EO*,,!j E`O*a,E`O__"E`O___ E`O__"E`O___ E`Oaa&E`O_j2_a aE`YhO__%E`O_a%E`YhO_a_a%E`YhO__%E`O_a%E`O_a_a %E`YhO__%E`Oa!%%a"%%E`#O_#a$,a%"_#[a&\[Zk\Za%2a'%a(&E`#YhO*,a),E`*O_*a$,a+a,_*%E`*YhO*,a-,E`.O*a/,a0-j 1E`2Oa3_%a4%_%a5%_*%a6%_.%a7%_2%E`8O*a,a9 a:E`;Y_#a<%_8%E`;YhUYhUFiner Feelings SpoonGa Ga Ga Ga Ga%5 04:53RFiner Feelings by Spoon on Ga Ga Ga Ga Ga 04:54  >(5 stars) 04:53/04:54, 12 of 12Finer Feelings by Spoon on Ga Ga Ga Ga Ga (5 stars) 04:53/04:54, 12 of 12ascr ޭ