Skype and iTunes, a modification of Sean’s code
Posted on | January 12, 2007 | 5 Comments
I found Sean’s entry on setting his Skype status to the current iTunes track and immediately implemented it. Love it! But I had one problem, Sometimes I fire off iTunes to listen to a song in the music store before downloading, or am listenning to (or watching) a podcast and don’t care to have that sent over the intertubes, and more than that, don’t care to have Proxi launch Skype so it can update my status, when I don’t care to have skype running.
This minor mod doesn’t solve all situations, but if Skype isn’t running, and you’re using iTunes, Skype won’t be launched just so it update your status (which for me, happens a lot, so if nothing else, this helps me A LOT).
Here’s the entire piece of code, I’ve bolded my additions.
set messageText to ""
set SkypeIsRunning to 0
try
tell application "iTunes"
set trackName to name of current track
set trackArtist to artist of current track
set trackAlbum to album of current track
end tell
if not trackArtist = "" then
set trackArtist to " by " & trackArtist
end if
if not trackAlbum = "" then
set trackAlbum to " from " & trackAlbum
end if
set messageText to trackName & trackArtist & trackAlbum
end try
set commandText to "SET PROFILE MOOD_TEXT " & messageText
tell application "System Events"
set SkypeIsRunning to count (every process whose name is "Skype")
end tell
if SkypeIsRunning > 0 then
tell application "Skype"
send command commandText script name "test"
end tell
end if
If Skype isn’t running, SkypeIsRunning will be 0. If it’s 0 then I don’t want to update my status.
Comments
5 Responses to “Skype and iTunes, a modification of Sean’s code”
Leave a Reply



March 22nd, 2007 @ 12:00 am
so how do i use this?
i¥m a applescript noob ;)
thx in advance.
March 25th, 2007 @ 12:00 am
@marcus,
So you’ll still follow Sean’s basic setup instructions, but where his applescript is, you could use mine. I use Proxi (mentioned in sean’s comments). It has a built in itunes watcher. Which will fire this script off. Sean’s will cause Skype to open if it isn’t, mine simply checks to see if it’s open before setting the status.
October 13th, 2008 @ 12:00 am
thnx!
January 7th, 2009 @ 2:45 am
@marcus,
So you'll still follow Sean's basic setup instructions, but where his applescript is, you could use mine. I use Proxi (mentioned in sean's comments). It has a built in itunes watcher. Which will fire this script off. Sean's will cause Skype to open if it isn't, mine simply checks to see if it's open before setting the status.
January 7th, 2009 @ 2:45 am
so how do i use this?
i¥m a applescript noob ;)
thx in advance.