<?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/"
	>

<channel>
	<title>Guimkie &#187; AppleScript</title>
	<atom:link href="http://guimkie.com/category/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://guimkie.com</link>
	<description>Tutorials and great Mac software!</description>
	<lastBuildDate>Sun, 04 Dec 2011 21:05:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding The Sparkle Framework</title>
		<link>http://guimkie.com/tutorials/adding-the-sparkle-framework/</link>
		<comments>http://guimkie.com/tutorials/adding-the-sparkle-framework/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 19:41:59 +0000</pubDate>
		<dc:creator>Max (from Guimkie)</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Sparkle]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://guimkie.com/tutorials/adding-the-sparkle-framework/</guid>
		<description><![CDATA[As I have been working for the Developer Tools from Apple for quite a while now, I have really gotten into finding out about all sorts of nice things that others have created for the developer community. One of them is the Sparkle Framework. This framework allows you to automatically update your application via appcasts [...]]]></description>
			<content:encoded><![CDATA[<p>As I have been working for the Developer Tools from Apple for quite a while now, I have really gotten into finding out about all sorts of nice things that others have created for the developer community. One of them is the <a target="_blank" href="http://sparkle.andymatuschak.org">Sparkle Framework</a>. This framework allows you to automatically update your application via appcasts and deliver them right to your customers; just like Apple&#8217;s Software Update application.</p>
<p>So integrating and using this framework is just a charm. I really suggest that you use it! Although the framework works totally fine it really lacks a good documentation for those who are new to this whole developing community (or are coding in a different language other than Cocoa). So I thought I&#8217;d make a tutorial that should make life easier. I fiddled ages with the original documentation until I got it to work &#8211; which wasn&#8217;t that exciting.</p>
<p>BTW &#8211; The <a target="_blank" href="http://foolsworkshop.com">Foolworkshop</a> (by K. Lawson) has also done a <a target="_blank" href="http://foolsworkshop.com/applescript/2008/05/adding-a-check-updates-feature/">tutorial</a> which includes larger images. Take a look at that as well.</p>
<p><span id="more-99"></span></p>
<p style="text-align:center;"><script type="text/javascript"><!--
google_ad_client = "pub-7241091367075931";
//Guimkie Header for Bubbled Theme
google_ad_slot = "4991557821";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>So, let&#8217;s start this thing:</p>
<ol>
<li>First you have to download the <a target="_blank" href="http://sparkle.andymatuschak.org">Sparkle framework</a>.<br />Note: The framework is currently at like version 1.1, apparently, this version does not work with AppleScript applications. I have modified the 1.1 version with the 2.0 beta stuff to create a working version for AppleScript applications. You can download it <a href="http://guimkie.com/downloads/load.php?id=29">here</a> (It works for Cocoa applications as well and I actually recommend using it because of stability reasons on Leopard).<br />Then, open your project.
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle1.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Now drag and drop the downloaded &#8220;Sparkle.framework&#8221; folder into the &#8220;Linked Frameworks&#8221; in Xcode:
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle2.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Now toggle the &#8220;Targets&#8221; icon in the sidebar of Xcode and right-click to add a new &#8220;Copy Build Phase:&#8221;
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle3.png" class="GUIMKIE-image-list"/></p>
<p>When the info window pops up, set the copy phase to &#8220;Frameworks:&#8221;
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle4.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Then drag the &#8220;Sparkle.framework&#8221; from the &#8220;Linked Frameworks&#8221; folder in Xcode, to the newly create build phase:
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle5.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Now open up the standard Info.plist file and add the SUFeedURL which is defined in the documentation of Sparkle. This is the part which tells Sparkle which RSS file on the internet it should check in order to receive the updates. It should look something like this:
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle6.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Now you have all the steps you need in Xcode. Thus, we will move on to applying the &#8220;Check for updates&#8221; menu item to your nib file and binding it to the framework.<br />So open up the nib file in Interface Builder and from the &#8220;File&#8221; menu, choose to read the class files of your &#8220;Sparkle.framework.&#8221; Simply navigate to the framework which is inside your Xcode project and select all the header files:
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle7.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Getting a little bit more messy, we are going to have to add a NSObject. So, from the Library in Xcode drag the NSObject (the blue box) to your nib file and name it &#8220;Updater&#8221; from within the attributes tab in the inspector.
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle8.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Then select the NSObject and go to the identity tab in the inspector and add a new &#8220;id&#8221; action named &#8220;checkForUpdates:&#8221; Don&#8217;t forget the colon at the end! Of course and most importantly, set the class to &#8220;SUUpdater!&#8221;
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle9.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Short and easy: add a new menu item and right-click drag to connect it to the Updater NSObject:
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle10.png" class="GUIMKIE-image-list"/></p>
<p>
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle11.png" class="GUIMKIE-image-list"/></p>
<p>
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle12.png" class="GUIMKIE-image-list"/></p>
</li>
<li>Now you are close to being finished. You only need to create an appcast (you can find a sample in the Sparkle documentation) and finish your app. Then your ready to go to release updates.<br />Optionally, you can also create a preference option that would allow the user to configure if they want to check for updates on start up or not. If you want to add it, what you do is you create your preferences window with a checkbox. Then bind it to the user defaults key of &#8220;SUCheckAtStartup.&#8221; Please not that this bind is only for versions before Sparkle 1.5. The newest release has a different binding value, which is &#8220;SUEnableAutomaticChecks.&#8221; Choose according to your Sparkle version.
<p style="text-align:center;"><img src="http://guimkie.com/files/images/sparkle13.png" class="GUIMKIE-image-list"/></p>
</li>
</ol>
<p>Finished! Check if it works. If you wish you can <a href="http://guimkie.com/downloads/load.php?id=29">download</a> the sample AppleScript Xcode project that I have used if you wish.</p>
<p>If you have enjoyed this tutorial, then you might consider making a small donation. Feel free to do so by clicking <a href="http://guimkie.com/about/">here</a>.</p>
<p style="text-align:center;"><script type="text/javascript"><!--
google_ad_client = "pub-7241091367075931";
//Guimkie Header for Bubbled Theme
google_ad_slot = "4991557821";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://guimkie.com/tutorials/adding-the-sparkle-framework/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

