<?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; Shortcuts</title>
	<atom:link href="http://www.cneophytou.com/tag/shortcuts/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>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>
