<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Voodoo Programming &#187; Quicksilver</title>
	<atom:link href="http://www.cneophytou.com/tag/quicksilver/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cneophytou.com</link>
	<description>Things programmers do that they know shouldn&#039;t work but they try anyway, and which sometimes actually work, such as recompiling everything.</description>
	<lastBuildDate>Tue, 20 Oct 2009 13:54:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Automatically restart crashed applications</title>
		<link>http://www.cneophytou.com/2007/10/14/automatically-restart-crashed-applications/</link>
		<comments>http://www.cneophytou.com/2007/10/14/automatically-restart-crashed-applications/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 21:31:07 +0000</pubDate>
		<dc:creator>Constantinos</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Applescript]]></category>
		<category><![CDATA[CC Licence]]></category>
		<category><![CDATA[Folder Actions]]></category>
		<category><![CDATA[Quicksilver]]></category>

		<guid isPermaLink="false">http://www.cneophytou.com/2007/10/15/automatically-restart-crashed-applications/</guid>
		<description><![CDATA[I love Quicksilver. If I ever sit on a machine without it, I feel handicapped, like something extremely important is missing. My major gripe with Quicksilver (and, this might just be my setup, I&#8217;m not sure), is that it likes to crash a lot. At least 2-3 times a week. And when it crashes, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[I love Quicksilver. If I ever sit on a machine without it, I feel handicapped, like something extremely important is missing. My major gripe with Quicksilver (and, this might just be my setup, I&#8217;m not sure), is that it likes to crash a lot. At least 2-3 times a week. And when it crashes, it&#8217;s extremely annoying because when I need to start a program up I use, well, Quicksilver!<br />
<br />
<span class='update'>Updated 2008-01-11:</span> Modified script for Leopard. New script at end of post.<br />
<br />
<span id="more-103"></span>
I&#8217;ve found a couple of different methods for relaunching Quicksilver easily or automatically. One was to keep an alias to Quicksilver on the bottom-left part of your desktop with no icon, and named as &#8221; &#8221; (i.e. a space). So when Quicksilver is off and you want to start it, you cmd-tab to the Finder, hit space, and cmd-o. Quick, easy, does the job, but hardly clean (or nerdy!).<br />
<br />
The other approach which I loved was playing around with launchd (found on <a href='http://www.macworld.com/weblogs/macosxhints/2007/04/autorestart/index.php'>MacWorld</a> and <a href='http://www.macosxhints.com/article.php?story=20060927132601570'>macosxhints.com</a>). With this service we can monitor a file for modifications, and when the file is modified we can perform an action. In this case, we would monitor the file <code>/Users/username/Library/Logs/CrashReporter/Quicksilver.crash.log</code>, and once its modified, launch Quicksilver. Clean, fully automated, but hardly simple. To make the task easier, <a href='http://lingon.sourceforge.net/'>Lingon</a> can be used to deal with launchd. However, I was never able to make this to work, and I don&#8217;t have the patience to sit down and figure out what the problem is.<br />
<br />
I did like the idea of monitoring Quicksilver.crash.log since that&#8217;s a direct indication that the application has crashed, but other than launchd I&#8217;m not familiar with any other automated service that can monitor for modifications in a file. I am however familiar with an automated service that monitors for modifications in a folder, courtesy of OS X, and that&#8217;s folder actions.<br />
<br />
I can therefore build a folder action which will monitor  <code>/Users/username/Library/Logs/CrashReporter/</code> for changes, see what files were added, and if a &#8216;marked&#8217; file was added then relaunch the relevant application and (this part is critical) delete the crash log so the script can work again. It took a couple of tries, but I think I found the most robust solution for this approach.<br />
</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">property</span> restartLog : <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Quicksilver.crash.log&quot;</span><span style="color: #000000;">&#125;</span>
<span style="color: #ff0033; font-weight: bold;">property</span> restartID : <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;daed&quot;</span><span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #0066ff;">adding</span> <span style="color: #0066ff;">folder</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">to</span> this_folder <span style="color: #ff0033;">after</span> <span style="color: #0066ff;">receiving</span> these_items
    <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> i <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">number</span> <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">in</span> these_items
        <span style="color: #ff0033; font-weight: bold;">set</span> fileAlias <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> these_items <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">alias</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> fileInfo <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">info for</span> fileAlias
        <span style="color: #ff0033; font-weight: bold;">set</span> fileName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> fileInfo <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> fileName <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033; font-weight: bold;">in</span> restartLog <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #0066ff;">beep</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> itm <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">my</span> list_position<span style="color: #000000;">&#40;</span>fileName, restartLog<span style="color: #000000;">&#41;</span>
            <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span>
                <span style="color: #0066ff;">open</span> <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">file</span> <span style="color: #0066ff;">id</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">item</span> itm <span style="color: #ff0033; font-weight: bold;">of</span> restartID<span style="color: #000000;">&#41;</span>
                <span style="color: #0066ff;">delete</span> <span style="color: #0066ff;">item</span> fileAlias
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #0066ff;">adding</span> <span style="color: #0066ff;">folder</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">to</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> list_position<span style="color: #000000;">&#40;</span>this_item, this_list<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> i <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033;">the</span> <span style="color: #0066ff;">count</span> <span style="color: #ff0033; font-weight: bold;">of</span> this_list
        <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> this_list <span style="color: #ff0033; font-weight: bold;">is</span> this_item <span style="color: #ff0033; font-weight: bold;">then</span> <span style="color: #ff0033; font-weight: bold;">return</span> i
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
    <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">0</span>
<span style="color: #ff0033; font-weight: bold;">end</span> list_position</pre></div></div>



<p>
<a href="http://www.cneophytou.com/wp-content/uploads/2007/10/restartcrashedapp.scpt">Download this script</a><br />
<br />
Note that to get this to work initially, you&#8217;ll have to open that folder and delete the existing Quicksilver.crash.log, otherwise this folder action will never kick in for Quicksilver!<br />
<br />
The critical part are the two properties at the top. The first property contains the name of the file to watch for, and the second property contains (in the same order as in the first property) the application file id for the related application. The reason for using the application file id is that this will remain constant on every system even if the application is renamed by the user.<br />
<br />
This script can be expanded to listen for any number of applications simply by adding the two parameters for each application to these properties. To get the application file id of the application you wish to monitor, simply run this code once in Script Editor while the target application is running:<br />
</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">return</span> creator type <span style="color: #ff0033; font-weight: bold;">of</span> process <span style="color: #009900;">&quot;Process Name&quot;</span></pre></div></div>



<p>
and watch the output.<br />
<br />
As a side note, with this method you can chose to do any number of things instead of just relaunching the crashed application since it&#8217;s straight forward applescript. In my version I chose to &#8216;beep&#8217; as well, to let me know something went wrong (and the file trash sound is also a giveaway), but you really could do anything you want here.<br />
<br />
<span class='update'>Leopard Update:</span><br />
<br />
There have been a few changes in the way Leopard handles the crash log files, which simplifies the use of this script. Instead of using a single crash log file for each application and appending to it, Leopard simply creates a new timestamped crash log in the form <code>Name_YYYY-MM-DD-TIME_Hostname.crash</code>. This is easier, because we no longer have to worry about deleting the crash log, we can simply check if the newly added log starts with *Name*. Therefore, a simpler version of the above applescript (that can only work with a single app, but switching to lists shouldn&#8217;t be too hard), follows:<br />
</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">property</span> restartName : <span style="color: #009900;">&quot;Quicksilver&quot;</span>
<span style="color: #ff0033; font-weight: bold;">property</span> restartID : <span style="color: #009900;">&quot;daed&quot;</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #0066ff;">adding</span> <span style="color: #0066ff;">folder</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">to</span> this_folder <span style="color: #ff0033;">after</span> <span style="color: #0066ff;">receiving</span> these_items
    <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> i <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">number</span> <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">in</span> these_items
        <span style="color: #ff0033; font-weight: bold;">set</span> fileAlias <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">item</span> i <span style="color: #ff0033; font-weight: bold;">of</span> these_items <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">alias</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> fileInfo <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">info for</span> fileAlias
        <span style="color: #ff0033; font-weight: bold;">set</span> fileName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> fileInfo <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> fileName starts <span style="color: #ff0033; font-weight: bold;">with</span> restartName <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #0066ff;">beep</span>
            <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span>
                <span style="color: #0066ff;">open</span> <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">file</span> <span style="color: #0066ff;">id</span> restartID
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #0066ff;">adding</span> <span style="color: #0066ff;">folder</span> <span style="color: #0066ff;">items</span> <span style="color: #ff0033; font-weight: bold;">to</span></pre></div></div>



<p>
<a href="http://www.cneophytou.com/wp-content/uploads/2007/10/restartcrashedapp_10.5.scpt">Download this script</a><br />
<br />
If anyone can figure out how to use applescript instead of the shell commands and still have it work, please let me know.]]></content:encoded>
			<wfw:commentRss>http://www.cneophytou.com/2007/10/14/automatically-restart-crashed-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iTunes scripts I can&#8217;t live without</title>
		<link>http://www.cneophytou.com/2007/07/24/itunes-scripts-i-cant-live-without/</link>
		<comments>http://www.cneophytou.com/2007/07/24/itunes-scripts-i-cant-live-without/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 18:04:22 +0000</pubDate>
		<dc:creator>Constantinos</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Applescript]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Quicksilver]]></category>
		<category><![CDATA[Shortcuts]]></category>

		<guid isPermaLink="false">http://www.cneophytou.com/2007/07/24/itunes-scripts-i-cant-live-without/</guid>
		<description><![CDATA[I have few obsessions in my life, and one of those happens to be keeping my iTunes library in some form (and definition) of &#8216;order&#8217;, without having me go completely insane. This involves keeping the ID3 data as accurate as I can make it (very tedious process as I had about 100 songs named Track [...]]]></description>
			<content:encoded><![CDATA[I have few obsessions in my life, and one of those happens to be keeping my iTunes library in some form (and definition) of &#8216;order&#8217;, without having me go completely insane. This involves keeping the ID3 data as accurate as I can make it (very tedious process as I had about 100 songs named Track 3 &#8211; Unknown Artist), but that is more or less under control. What I&#8217;m working on now is rating all of my music (I&#8217;m sure every one has their own rating scheme, and there&#8217;s no need to share mine here&#8230; Just suffice to say that a 0-star rating means the song hasn&#8217;t been reviewed), and also getting as much album artwork to go with iTune&#8217;s cover flow so I can use it without looking at the same default image every time&#8230;<br />
<br />
Doing all this manually would pretty much take up all my time, so over a period of few months (back when I first started dealing with my iTunes library), I built a few applescripts which help me manage all these tasks, and which are bound to keyboard shortcuts in Quicksilver.<br />
<span id="more-96"></span>
</p>
<h1>Rating</h1>
<p>
I have all the standard 0-5 star rating scripts, which are bound to cmd-opt-0 through cmd-opt-5 respectively. Since I use Growl, I wanted a notification to come up for this fact, and use the album artwork (if any) as the notification icon. This is the script for the 5 star rating, where for every other (0-4 stars) script the only modification is the actual rating (commented in the script)<br />
</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">property</span> emdash : «data utxt2014» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> black_star : «data utxt272F» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> white_star : «data utxt2606» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> dot : «data utxt00B7» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">set</span> appName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;GrowlHelperApp&quot;</span>
<span style="color: #ff0033; font-weight: bold;">set</span> app2Name <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes <span style="color: #ff0033;">contains</span> appName<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">and</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes <span style="color: #ff0033;">contains</span> app2Name<span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">then</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> class <span style="color: #ff0033; font-weight: bold;">of</span> current track <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033; font-weight: bold;">in</span> <span style="color: #000000;">&#123;</span>track, <span style="color: #0066ff;">file</span> track, URL track, device track, shared track, audio CD<span style="color: #000000;">&#125;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #808080; font-style: italic;">(* Increments of 20, from 0 to 100 for 0 - 5 stars *)</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> rating <span style="color: #ff0033; font-weight: bold;">of</span> current track <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">100</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">my</span> notifyTrack<span style="color: #000000;">&#40;</span>current track, player position, <span style="color: #009900;">&quot;5 Stars&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #808080; font-style: italic;">(* or whatever else you want *)</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> notifyTrack<span style="color: #000000;">&#40;</span>myTrack, pos, txt<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> trkName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkArtist <span style="color: #ff0033; font-weight: bold;">to</span> artist <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkAlbum <span style="color: #ff0033; font-weight: bold;">to</span> album <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkTime <span style="color: #ff0033; font-weight: bold;">to</span> time <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkRating <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>rating <span style="color: #ff0033; font-weight: bold;">of</span> myTrack<span style="color: #000000;">&#41;</span> <span style="color: #000000;">/</span> <span style="color: #000000;">20</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> trkPos <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">my</span> getTimeString<span style="color: #000000;">&#40;</span>pos<span style="color: #000000;">&#41;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> artworkCount <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">count</span> <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">if</span> artworkCount &gt; <span style="color: #000000;">0</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">tell</span> myTrack
                <span style="color: #ff0033; font-weight: bold;">set</span> trkArt <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>data <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
        <span style="color: #ff0033; font-weight: bold;">else</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> iTunesIcon <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Macintosh HD:Applications:iTunes.app:Contents:Resources:iTunes.icns&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trkArt <span style="color: #ff0033; font-weight: bold;">to</span> read <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> iTunesIcon<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">as</span> picture
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>txt <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">false</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> txt <span style="color: #ff0033; font-weight: bold;">to</span> trkName
            <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkPos <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trkTime <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> emdash <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">my</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkArtist <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkAlbum
        <span style="color: #ff0033; font-weight: bold;">else</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkName <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkPos <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trkTime <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> emdash <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">my</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkArtist
            <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trkAlbum <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">not</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkInfo <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; (&quot;</span> <span style="color: #000000;">&amp;</span> trkAlbum <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;)&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">my</span> showQSNotify<span style="color: #000000;">&#40;</span>txt, trkArt, trkInfo<span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> notifyTrack
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">repeat</span> trkRating <span style="color: #ff0033; font-weight: bold;">times</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> stars <span style="color: #000000;">&amp;</span> black_star
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
    <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span> <span style="color: #000000;">-</span> trkRating<span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">times</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> stars <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> dot
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
    <span style="color: #ff0033; font-weight: bold;">return</span> stars
<span style="color: #ff0033; font-weight: bold;">end</span> showStars
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showQSNotify<span style="color: #000000;">&#40;</span>txt, trkArt, trkInfo<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;GrowlHelperApp&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #ff0033;">the</span> allNotificationsList <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Rating Change&quot;</span>, <span style="color: #009900;">&quot;Song Skipping&quot;</span>, <span style="color: #009900;">&quot;Song Info&quot;</span><span style="color: #000000;">&#125;</span>
        register <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">application</span> ¬
            <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span> all notifications allNotificationsList default notifications allNotificationsList ¬
            icon <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
&nbsp;
        <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trkArt <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">missing value</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            notify <span style="color: #ff0033; font-weight: bold;">with</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Rating Change&quot;</span> title txt description trkInfo <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">else</span>
            notify <span style="color: #ff0033; font-weight: bold;">with</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Rating Change&quot;</span> title txt description trkInfo <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span> pictImage <span style="color: #ff0033;">the</span> trkArt
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> showQSNotify
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showTrackInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">try</span>
        <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;GrowlTunes&quot;</span>
            show current track
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
<span style="color: #ff0033; font-weight: bold;">end</span> showTrackInfo
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> getTimeString<span style="color: #000000;">&#40;</span>secs<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_seconds <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033;">the</span> secs <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">number</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">div</span> <span style="color: #000000;">60</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_seconds <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">mod</span> <span style="color: #000000;">60</span>
    <span style="color: #ff0033; font-weight: bold;">if</span> no_seconds <span style="color: #000000;">&lt;</span> <span style="color: #000000;">10</span> <span style="color: #ff0033; font-weight: bold;">then</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> seconds_text <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;0&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_seconds <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">else</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> seconds_text <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">if</span> no_minutes ≥ <span style="color: #000000;">60</span> <span style="color: #ff0033; font-weight: bold;">then</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> no_hours <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">div</span> <span style="color: #000000;">60</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">mod</span> <span style="color: #000000;">60</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> no_minutes <span style="color: #000000;">&lt;</span> <span style="color: #000000;">10</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;0&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> minutes_text <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>no_hours <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">else</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> minutes_text <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">return</span> minutes_text <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> seconds_text
<span style="color: #ff0033; font-weight: bold;">end</span> getTimeString</pre></div></div>



<p><a href="http://www.cneophytou.com/wp-content/uploads/2007/07/rating.scpt">Download this script</a></p>
<h1>Skipping</h1>
<p>
Sometimes, I find myself having a few hours of free time, where I want to just sit down and rate all my unrated songs. Instead of using the mouse to skip through every song (since I&#8217;ve already heard all of them, I just haven&#8217;t considered a rating for them), I have a script that skips a quarter of the song on each press, and places the playhead at 3 seconds from the end on the 4th activation. Useful for quickly skipping through a song.<br />
</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">property</span> emdash : «data utxt2014» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> black_star : «data utxt272F» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> white_star : «data utxt2606» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> dot : «data utxt00B7» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">set</span> appName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;GrowlHelperApp&quot;</span>
<span style="color: #ff0033; font-weight: bold;">set</span> app2Name <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes <span style="color: #ff0033;">contains</span> appName<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">and</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes <span style="color: #ff0033;">contains</span> app2Name<span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">then</span>
    <span style="color: #ff0033; font-weight: bold;">try</span>
        <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> myTrack <span style="color: #ff0033; font-weight: bold;">to</span> current track
            <span style="color: #ff0033; font-weight: bold;">set</span> dur <span style="color: #ff0033; font-weight: bold;">to</span> duration <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
            <span style="color: #ff0033; font-weight: bold;">set</span> q1 <span style="color: #ff0033; font-weight: bold;">to</span> dur <span style="color: #000000;">/</span> <span style="color: #000000;">4</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> q2 <span style="color: #ff0033; font-weight: bold;">to</span> q1 <span style="color: #000000;">*</span> <span style="color: #000000;">2</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> q3 <span style="color: #ff0033; font-weight: bold;">to</span> q1 <span style="color: #000000;">*</span> <span style="color: #000000;">3</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> q4 <span style="color: #ff0033; font-weight: bold;">to</span> dur <span style="color: #000000;">-</span> <span style="color: #000000;">3</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> curPos <span style="color: #ff0033; font-weight: bold;">to</span> player position
            <span style="color: #ff0033; font-weight: bold;">set</span> counter <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">0</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> theList <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#123;</span>q1, q2, q3, q4, dur<span style="color: #000000;">&#125;</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> pos <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">0</span>
            <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">while</span> pos <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">less</span> than <span style="color: #ff0033;">or</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> curPos
                <span style="color: #ff0033; font-weight: bold;">set</span> counter <span style="color: #ff0033; font-weight: bold;">to</span> counter <span style="color: #000000;">+</span> <span style="color: #000000;">1</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> pos <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">item</span> counter <span style="color: #ff0033; font-weight: bold;">of</span> theList
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
            <span style="color: #ff0033; font-weight: bold;">if</span> pos <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">less</span> than <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">then</span> <span style="color: #ff0033; font-weight: bold;">set</span> pos <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">1</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> player position <span style="color: #ff0033; font-weight: bold;">to</span> pos
&nbsp;
            <span style="color: #ff0033; font-weight: bold;">if</span> counter <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">greater</span> than <span style="color: #000000;">3</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">my</span> notifyTrack<span style="color: #000000;">&#40;</span>myTrack, player position, <span style="color: #009900;">&quot;Ending Song&quot;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #ff0033; font-weight: bold;">else</span>
                <span style="color: #ff0033; font-weight: bold;">my</span> notifyTrack<span style="color: #000000;">&#40;</span>myTrack, player position, <span style="color: #009900;">&quot;Song Skip&quot;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
            <span style="color: #808080; font-style: italic;">(* my showTrackInfo() *)</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> notifyTrack<span style="color: #000000;">&#40;</span>myTrack, pos, txt<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> trkName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkArtist <span style="color: #ff0033; font-weight: bold;">to</span> artist <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkAlbum <span style="color: #ff0033; font-weight: bold;">to</span> album <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkTime <span style="color: #ff0033; font-weight: bold;">to</span> time <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkRating <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>rating <span style="color: #ff0033; font-weight: bold;">of</span> myTrack<span style="color: #000000;">&#41;</span> <span style="color: #000000;">/</span> <span style="color: #000000;">20</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> trkPos <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">my</span> getTimeString<span style="color: #000000;">&#40;</span>pos<span style="color: #000000;">&#41;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> artworkCount <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">count</span> <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">if</span> artworkCount &gt; <span style="color: #000000;">0</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">tell</span> myTrack
                <span style="color: #ff0033; font-weight: bold;">set</span> trkArt <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>data <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
        <span style="color: #ff0033; font-weight: bold;">else</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> iTunesIcon <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Macintosh HD:Applications:iTunes.app:Contents:Resources:iTunes.icns&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trkArt <span style="color: #ff0033; font-weight: bold;">to</span> read <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> iTunesIcon<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">as</span> picture
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>txt <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">false</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> txt <span style="color: #ff0033; font-weight: bold;">to</span> trkName
            <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkPos <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trkTime <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> emdash <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">my</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkArtist <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkAlbum
        <span style="color: #ff0033; font-weight: bold;">else</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkName <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkPos <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trkTime <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> emdash <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">my</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkArtist
            <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trkAlbum <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">not</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkInfo <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; (&quot;</span> <span style="color: #000000;">&amp;</span> trkAlbum <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;)&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">my</span> showQSNotify<span style="color: #000000;">&#40;</span>txt, trkArt, trkInfo<span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> notifyTrack
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">repeat</span> trkRating <span style="color: #ff0033; font-weight: bold;">times</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> stars <span style="color: #000000;">&amp;</span> black_star
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
    <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span> <span style="color: #000000;">-</span> trkRating<span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">times</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> stars <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> dot
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
    <span style="color: #ff0033; font-weight: bold;">return</span> stars
<span style="color: #ff0033; font-weight: bold;">end</span> showStars
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showQSNotify<span style="color: #000000;">&#40;</span>txt, trkArt, trkInfo<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;GrowlHelperApp&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #ff0033;">the</span> allNotificationsList <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Rating Change&quot;</span>, <span style="color: #009900;">&quot;Song Skipping&quot;</span>, <span style="color: #009900;">&quot;Song Info&quot;</span><span style="color: #000000;">&#125;</span>
        register <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">application</span> ¬
            <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span> all notifications allNotificationsList default notifications allNotificationsList ¬
            icon <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
&nbsp;
        <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trkArt <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">missing value</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            notify <span style="color: #ff0033; font-weight: bold;">with</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Song Skipping&quot;</span> title txt description trkInfo <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">else</span>
            notify <span style="color: #ff0033; font-weight: bold;">with</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Song Skipping&quot;</span> title txt description trkInfo <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span> pictImage <span style="color: #ff0033;">the</span> trkArt
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> showQSNotify
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showTrackInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">try</span>
        <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;GrowlTunes&quot;</span>
            show current track
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
<span style="color: #ff0033; font-weight: bold;">end</span> showTrackInfo
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> getTimeString<span style="color: #000000;">&#40;</span>secs<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_seconds <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033;">the</span> secs <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">number</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">div</span> <span style="color: #000000;">60</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_seconds <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">mod</span> <span style="color: #000000;">60</span>
    <span style="color: #ff0033; font-weight: bold;">if</span> no_seconds <span style="color: #000000;">&lt;</span> <span style="color: #000000;">10</span> <span style="color: #ff0033; font-weight: bold;">then</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> seconds_text <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;0&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_seconds <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">else</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> seconds_text <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">if</span> no_minutes ≥ <span style="color: #000000;">60</span> <span style="color: #ff0033; font-weight: bold;">then</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> no_hours <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">div</span> <span style="color: #000000;">60</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">mod</span> <span style="color: #000000;">60</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> no_minutes <span style="color: #000000;">&lt;</span> <span style="color: #000000;">10</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;0&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> minutes_text <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>no_hours <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">else</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> minutes_text <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">return</span> minutes_text <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> seconds_text
<span style="color: #ff0033; font-weight: bold;">end</span> getTimeString</pre></div></div>



<p>
<a href="http://www.cneophytou.com/wp-content/uploads/2007/07/skipping.scpt">Download this script</a><br />
<br />
This method works well with a couple of smart playlists and clever manipulation of the Party Shuffle feature. I have two smart playlists (one of them is used to filter out tv shows and movies, but not video clips). One is named &#8220;Other Video&#8221;, and has the following rules:</p>
<ul><li>Match <strong>any</strong> of the following:</li>
<li>Video kind is Movie</li>
<li>Video kind is TV Show</li>
</ul>
<p>
The other is named &#8220;All Unrated&#8221;, and has the following rules:<br /></p>
<ul>
<li>Match <strong>all</strong> of the following:</li>
<li>My rating is less than 1 star</li>
<li>Podcast is false</li>
<li>Playlist is not Other Video</li>
</ul>
<p>
Finally, in Party Shuffle, at the bottom, I have Source: &#8220;All Unrated&#8221;, Display 5 recently played songs, and 15 upcoming songs. This way, even though the song I just rate will be removed from the &#8220;All Unrated&#8221; smart playlist, it won&#8217;t stop playing as it&#8217;s in the Party Shuffle playlist.<br />
</p>
<h1>Artwork</h1>
<p>
I first ran &#8220;Get Album Artwork&#8221; in iTunes, but obviously that had a fairly limited success as a lot of my music has vital information like Album missing, and also a lot of the music I listen to isn&#8217;t even in the iTunes store. To cover the gap, I&#8217;m a fanatic <a href='http://growl.info/documentation/growltunes.php'>GrowlTunes</a> user, which does all the heavy work of fetching album covers (sometimes more successfully than others). GrowlTunes first looks for album artwork in the song itself, and if it doesn&#8217;t find any it then fetches it from the internet to display the Growl alert. What it does NOT do is save it with the song, but it DOES save it locally so it doesn&#8217;t have to fetch it again (in my opinion this is a very good thing as anything under a 95% success ratio you&#8217;ll want to review, and GrowlTunes is more like 70%). So what I&#8217;ve done is prepared a script that, for the current track, looks at the default GrowlTunes location, and if it finds an album cover it adds it to the song (to run it, you will need to replace your own short user name at the first line of the script):<br />
</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">property</span> myUserName : <span style="color: #009900;">&quot;Constantinos&quot;</span>
<span style="color: #ff0033; font-weight: bold;">property</span> appName : <span style="color: #009900;">&quot;iTunes&quot;</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">set</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes <span style="color: #ff0033;">contains</span> appName
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">then</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">try</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> myTrack <span style="color: #ff0033; font-weight: bold;">to</span> current track
            <span style="color: #ff0033; font-weight: bold;">set</span> trackName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
            <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trackName <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> trackName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Unknown Track&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trackArtist <span style="color: #ff0033; font-weight: bold;">to</span> artist <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
            <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trackArtist <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> trackArtist <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Unknown Artist&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trackAlbum <span style="color: #ff0033; font-weight: bold;">to</span> album <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
            <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trackAlbum <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> trackAlbum <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Unknown Album&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">set</span> artworkFilename <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;/Users/&quot;</span> <span style="color: #000000;">&amp;</span> myUserName <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/Library/Images/Music/&quot;</span> <span style="color: #000000;">&amp;</span> trackArtist <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trackAlbum <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/Tracks/&quot;</span> <span style="color: #000000;">&amp;</span> trackName <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/Track.png&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> deleteFilename <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Macintosh HD:Users:&quot;</span> <span style="color: #000000;">&amp;</span> myUserName <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:Library:Images:Music:&quot;</span> <span style="color: #000000;">&amp;</span> trackArtist <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> trackAlbum <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:Tracks:&quot;</span> <span style="color: #000000;">&amp;</span> trackName <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:Track.png&quot;</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">set</span> deleteCoverFilename <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Macintosh HD:Users:&quot;</span> <span style="color: #000000;">&amp;</span> myUserName <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:Library:Images:Music:&quot;</span> <span style="color: #000000;">&amp;</span> trackArtist <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> trackAlbum <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:Cover.png&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> albumCoverFilename <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;/Users/&quot;</span> <span style="color: #000000;">&amp;</span> myUserName <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/Library/Images/Music/&quot;</span> <span style="color: #000000;">&amp;</span> trackArtist <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trackAlbum <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/Cover.png&quot;</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">set</span> tempfile <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Macintosh HD:tmp:temporary.pict&quot;</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Image Events&quot;</span>
        <span style="color: #808080; font-style: italic;">(* set artworkFile to (POSIX file artworkFilename)
        set myImage to open (artworkFile as alias) *)</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> myImage <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">open</span> artworkFilename
        <span style="color: #ff0033; font-weight: bold;">try</span>
            <span style="color: #0066ff;">save</span> myImage <span style="color: #ff0033;">as</span> PICT <span style="color: #ff0033; font-weight: bold;">in</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> tempfile<span style="color: #000000;">&#41;</span>
        <span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #ff0033; font-weight: bold;">error</span>
            <span style="color: #ff0033; font-weight: bold;">try</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> deleteFilename <span style="color: #ff0033; font-weight: bold;">to</span> deleteCoverFilename
                <span style="color: #ff0033; font-weight: bold;">set</span> myImage <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">open</span> albumCoverFilename
                <span style="color: #0066ff;">save</span> myImage <span style="color: #ff0033;">as</span> PICT <span style="color: #ff0033; font-weight: bold;">in</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> tempfile<span style="color: #000000;">&#41;</span>
            <span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #ff0033; font-weight: bold;">error</span>
                <span style="color: #ff0033; font-weight: bold;">return</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
        <span style="color: #0066ff;">close</span> myImage
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> myTrack <span style="color: #ff0033; font-weight: bold;">to</span> current track
        <span style="color: #ff0033; font-weight: bold;">set</span> artworkCount <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">count</span> <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> myArt <span style="color: #ff0033; font-weight: bold;">to</span> read <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> tempfile<span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">from</span> <span style="color: #000000;">513</span> <span style="color: #ff0033;">as</span> picture
        <span style="color: #ff0033; font-weight: bold;">if</span> artworkCount &gt; <span style="color: #000000;">0</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> data <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #000000;">&#40;</span>artworkCount <span style="color: #000000;">+</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">of</span> current track <span style="color: #ff0033; font-weight: bold;">to</span> myArt
        <span style="color: #ff0033; font-weight: bold;">else</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> data <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">of</span> current track <span style="color: #ff0033; font-weight: bold;">to</span> myArt
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Image Events&quot;</span>
        <span style="color: #0066ff;">delete</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> tempfile<span style="color: #000000;">&#41;</span>
        <span style="color: #0066ff;">delete</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> deleteFilename<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span></pre></div></div>



<p><a href="http://www.cneophytou.com/wp-content/uploads/2007/07/artwork.scpt">Download this script</a></p>
<h1>Notifications</h1>
<p>
The first two scripts use the same &#8220;Hotkey iTunes Notification&#8221; application name to register with Growl, with three types of notification: &#8220;Rating Change&#8221;, &#8220;Song Skipping&#8221; and &#8220;Song Info&#8221;. The last one simply brings up a detailed notification dialog with the current song&#8217;s playhead position, title, artist, rating, album and album art, which can all fit in the small &#8220;Smoke&#8221; style notification window. If you&#8217;re interested in that, the script follows:<br />
</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">property</span> emdash : «data utxt2014» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> black_star : «data utxt272F» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> white_star : «data utxt2606» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">property</span> dot : «data utxt00B7» <span style="color: #ff0033;">as</span> Unicode <span style="color: #0066ff;">text</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">set</span> appName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;GrowlHelperApp&quot;</span>
<span style="color: #ff0033; font-weight: bold;">set</span> app2Name <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes <span style="color: #ff0033;">contains</span> appName<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">and</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> processes <span style="color: #ff0033;">contains</span> app2Name<span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> appIsRunning <span style="color: #ff0033; font-weight: bold;">then</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">my</span> notifyTrack<span style="color: #000000;">&#40;</span>current track, player position, <span style="color: #0066ff;">false</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> notifyTrack<span style="color: #000000;">&#40;</span>myTrack, pos, txt<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> trkName <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">name</span> <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkArtist <span style="color: #ff0033; font-weight: bold;">to</span> artist <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkAlbum <span style="color: #ff0033; font-weight: bold;">to</span> album <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkTime <span style="color: #ff0033; font-weight: bold;">to</span> time <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">set</span> trkRating <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>rating <span style="color: #ff0033; font-weight: bold;">of</span> myTrack<span style="color: #000000;">&#41;</span> <span style="color: #000000;">/</span> <span style="color: #000000;">20</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> trkPos <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">my</span> getTimeString<span style="color: #000000;">&#40;</span>pos<span style="color: #000000;">&#41;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> artworkCount <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">count</span> <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #ff0033; font-weight: bold;">of</span> myTrack
        <span style="color: #ff0033; font-weight: bold;">if</span> artworkCount &gt; <span style="color: #000000;">0</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">tell</span> myTrack
                <span style="color: #ff0033; font-weight: bold;">set</span> trkArt <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>data <span style="color: #ff0033; font-weight: bold;">of</span> artwork <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
        <span style="color: #ff0033; font-weight: bold;">else</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> iTunesIcon <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;Macintosh HD:Applications:iTunes.app:Contents:Resources:iTunes.icns&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trkArt <span style="color: #ff0033; font-weight: bold;">to</span> read <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">file</span> iTunesIcon<span style="color: #000000;">&#41;</span> <span style="color: #ff0033;">as</span> picture
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>txt <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">false</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> txt <span style="color: #ff0033; font-weight: bold;">to</span> trkName
            <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkPos <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trkTime <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> emdash <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">my</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkArtist <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkAlbum
        <span style="color: #ff0033; font-weight: bold;">else</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkName <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkPos <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;/&quot;</span> <span style="color: #000000;">&amp;</span> trkTime <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> emdash <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">my</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #ff0033; font-weight: bold;">return</span> <span style="color: #000000;">&amp;</span> trkArtist
            <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trkAlbum <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">not</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> trkInfo <span style="color: #ff0033; font-weight: bold;">to</span> trkInfo <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; (&quot;</span> <span style="color: #000000;">&amp;</span> trkAlbum <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;)&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">my</span> showQSNotify<span style="color: #000000;">&#40;</span>txt, trkArt, trkInfo<span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> notifyTrack
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showStars<span style="color: #000000;">&#40;</span>trkRating<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;&quot;</span>
    <span style="color: #ff0033; font-weight: bold;">repeat</span> trkRating <span style="color: #ff0033; font-weight: bold;">times</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> stars <span style="color: #000000;">&amp;</span> black_star
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
    <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span> <span style="color: #000000;">-</span> trkRating<span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">times</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> stars <span style="color: #ff0033; font-weight: bold;">to</span> stars <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; &quot;</span> <span style="color: #000000;">&amp;</span> dot
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
    <span style="color: #ff0033; font-weight: bold;">return</span> stars
<span style="color: #ff0033; font-weight: bold;">end</span> showStars
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showQSNotify<span style="color: #000000;">&#40;</span>txt, trkArt, trkInfo<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;GrowlHelperApp&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> <span style="color: #ff0033;">the</span> allNotificationsList <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Rating Change&quot;</span>, <span style="color: #009900;">&quot;Song Skipping&quot;</span>, <span style="color: #009900;">&quot;Song Info&quot;</span><span style="color: #000000;">&#125;</span>
        register <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">application</span> ¬
            <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span> all notifications allNotificationsList default notifications allNotificationsList ¬
            icon <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span>
&nbsp;
        <span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>trkArt <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">missing value</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            notify <span style="color: #ff0033; font-weight: bold;">with</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Song Info&quot;</span> title txt description trkInfo <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">else</span>
            notify <span style="color: #ff0033; font-weight: bold;">with</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Song Info&quot;</span> title txt description trkInfo <span style="color: #0066ff;">application</span> <span style="color: #0066ff;">name</span> <span style="color: #009900;">&quot;Hotkey iTunes Notification&quot;</span> pictImage <span style="color: #ff0033;">the</span> trkArt
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> showQSNotify
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> showTrackInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">try</span>
        <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;GrowlTunes&quot;</span>
            show current track
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span>
<span style="color: #ff0033; font-weight: bold;">end</span> showTrackInfo
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> getTimeString<span style="color: #000000;">&#40;</span>secs<span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_seconds <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033;">the</span> secs <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">number</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">div</span> <span style="color: #000000;">60</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> no_seconds <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">mod</span> <span style="color: #000000;">60</span>
    <span style="color: #ff0033; font-weight: bold;">if</span> no_seconds <span style="color: #000000;">&lt;</span> <span style="color: #000000;">10</span> <span style="color: #ff0033; font-weight: bold;">then</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> seconds_text <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;0&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_seconds <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">else</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> seconds_text <span style="color: #ff0033; font-weight: bold;">to</span> no_seconds <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #ff0033; font-weight: bold;">if</span> no_minutes ≥ <span style="color: #000000;">60</span> <span style="color: #ff0033; font-weight: bold;">then</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> no_hours <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">div</span> <span style="color: #000000;">60</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">mod</span> <span style="color: #000000;">60</span>
        <span style="color: #ff0033; font-weight: bold;">if</span> no_minutes <span style="color: #000000;">&lt;</span> <span style="color: #000000;">10</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> no_minutes <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;0&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> minutes_text <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span>no_hours <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #000000;">&#40;</span>no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span><span style="color: #000000;">&#41;</span>
    <span style="color: #ff0033; font-weight: bold;">else</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> minutes_text <span style="color: #ff0033; font-weight: bold;">to</span> no_minutes <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">string</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">return</span> minutes_text <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;:&quot;</span> <span style="color: #000000;">&amp;</span> seconds_text
<span style="color: #ff0033; font-weight: bold;">end</span> getTimeString</pre></div></div>



<p>
<a href="http://www.cneophytou.com/wp-content/uploads/2007/07/notifications.scpt">Download this script</a><br />
<br />
That&#8217;s pretty much it&#8230; Enjoy!]]></content:encoded>
			<wfw:commentRss>http://www.cneophytou.com/2007/07/24/itunes-scripts-i-cant-live-without/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
