<?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>Tyler Clemons &#187; AppleScript</title>
	<atom:link href="http://www.tylerclemons.com/tag/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tylerclemons.com</link>
	<description>tylerclemons.com</description>
	<lastBuildDate>Wed, 26 May 2010 18:39:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating Adium Scripts (thats what she said)</title>
		<link>http://www.tylerclemons.com/creating-adium-scripts-thats-what-she-said/</link>
		<comments>http://www.tylerclemons.com/creating-adium-scripts-thats-what-she-said/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 00:37:38 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Adium]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[thats what she said]]></category>

		<guid isPermaLink="false">http://www.tylerclemons.com/?p=234</guid>
		<description><![CDATA[I was talking to Ben and saw another opening for the classic and overused &#8220;That&#8217;s what she said&#8221; joke.  As I was typing it in, I realized I should just make it easier on myself and write a simple script to do it for me.  So I did.


Creating it is very simple. First, we need [...]]]></description>
			<content:encoded><![CDATA[<p>I was talking to Ben and saw another opening for the classic and overused &#8220;That&#8217;s what she said&#8221; joke.  As I was typing it in, I realized I should just make it easier on myself and write a simple script to do it for me.  So I did.</p>
<p><span id="more-234"></span></p>
<p><img title="More..." src="http://tylershome.nfshost.com/home/public/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p>Creating it is very simple. First, we need to setup a file structure.  Create a folder called <strong>whatshesaid.AdiumScripts</strong>.  Then right click(CTLR+click), and click &#8217;show package contents.&#8217;  Create a folder called <strong>Contents</strong>.  Inside Contents, create a folder called <strong>Resources</strong>.  The result:</p>
<p>-&gt;whatshesaid.AdiumScripts<br />
&#8211;&gt;Contents<br />
&#8212;-&gt;Resources</p>
<p>The next step is to create the actual script.  Enter the Resources folder.  Open up the Script Editor from the Applications folder.  If this is not installed, then just be prepared to save a file using the <em>.scpt</em> extension.  Create a function like this:</p>
<div id="codebox" style="overflow: auto; "><code><br />
<span style="color: #0000ff;">on</span> <span style="color: #008000;">substitute()</span><span style="padding-left: 10px;"><span style="color: #0000ff;"> </span></span><br />
<span style="padding-left: 10px;"><span style="color: #0000ff;">return</span> "thats what she said"</span><br />
<span style="color: #0000ff;">end</span> <span style="color: #008000;">substitute</span><br />
</code></div>
<p>The <em>on substitute() </em>function will be called every time the script is used.  Inside is an array of strings seperated by commas.   Now the question is, how do we use the script?</p>
<p>Go up one level back to the Contents folder.  Click <a href="http://www.tylerclemons.com/whatshesaid.zip">HERE</a> and drag the info.plist file into the directory.  If you changed any of the defaults, make the appropriate changes.</p>
<p>And that&#8217;s it.  Just click on the random.AdiumScripts icon and it should install.  Type<em> /she or %_she </em>in a chatbox to test the script. That&#8217;s the simplest way to do it. There are some other XML properties that can be added but aren&#8217;t necessary for personal use. If you plan on publishing on Adium&#8217;s website, be sure to add any and all public standards.</p>
<p>You can add more substitutions by creating more script files and more entries into the XML tree. You can also edit the triggers by changing <em>/she</em> to any character sequence.</p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><em>Your files will be installed in Library/Application Support/Adium 2.0/Scripts</em></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/creating-adium-scripts-thats-what-she-said/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating Adium Scripts (iTunes)</title>
		<link>http://www.tylerclemons.com/creating-adium-scripts-itunes/</link>
		<comments>http://www.tylerclemons.com/creating-adium-scripts-itunes/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 01:09:26 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Adium]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=41</guid>
		<description><![CDATA[I use Adium and iTunes frequently.  One of the cool things about the OS X environment is the integration between applications.  For instance, Adium contacts can be linked to Address Book accounts.  One of my personal favorites is the integration of Adium and iTunes.  Adium can display details of what is [...]]]></description>
			<content:encoded><![CDATA[<p>I use Adium and iTunes frequently.  One of the cool things about the OS X environment is the integration between applications.  For instance, Adium contacts can be linked to Address Book accounts.  One of my personal favorites is the integration of Adium and iTunes.  Adium can display details of what is currently playing on iTunes such as the name of the song and the artist.  The trick is customizing these messages so that they can be presented as suitable away or status messages.<br />
<span id="more-20"></span></p>
<p>The best way to learn these concepts is to open up one.  That is just what I did.  I found a script that formatted iTunes data.  I was not satisfied with all of its features so I modified it.  I left credit to the original authors in the modified script.</p>
<p>First, we need to create a file structure.  Create a folder called <strong>name.AdiumScripts</strong>.  name can be anything you like, just make sure you don&#8217;t forget it.  Then right click(CTLR+click), and click ’show package contents.’  Create a folder called <strong>Contents</strong>.  Inside Contents, create a folder called <strong>Resources</strong>.  The result:</p>
<p>-&gt;name.AdiumScripts<br />
–&gt;Contents<br />
—-&gt;Resources</p>
<p>Enter the contents folder. Click<span style="color: #888888;"> <a title="Info2" href="http://tylershome.nfshost.com/info2.zip" target="_blank">HERE</a></span> for the info.plist file that will direct Adium where to get your script.  Place it in the contents folder.</p>
<p>The following is how the file looks:</p>
<div id="codebox" style="overflow: auto; ">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple Computer//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;<br />
&lt;plist version=&#8221;1.0&#8243;&gt;<br />
&lt;dict&gt;<br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;English&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleExecutable&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;Adium&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleGetInfoString&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;Nameit&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleIdentifier&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;com.adiumx.iTunes.scripts&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;1.2&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundleName&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;<strong>name</strong>&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;CFBundlePackageType&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;AdIM&lt;/string&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;Scripts&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;array&gt;</span><br />
<span style="padding-left: 20px;">&lt;dict&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;File&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;string&gt;<span style="color: #ffff00;"><strong>name</strong></span>&lt;/string&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Keyword&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;string&gt;<strong>%<span style="color: #ffff00;">_name</span></strong>&lt;/string&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Prefix Only&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;false/&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Requires User Interaction&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;false/&gt;</span><br />
<span style="padding-left: 30px;">&lt;key&gt;Title&lt;/key&gt;</span><br />
<span style="padding-left: 30px;">&lt;string&gt;Message iTunes data&lt;/string&gt;</span><br />
<span style="padding-left: 20px;">&lt;/dict&gt;</span><br />
<span style="padding-left: 10px;">&lt;/array&gt;</span><br />
<span style="padding-left: 10px;">&lt;key&gt;Set&lt;/key&gt;</span><br />
<span style="padding-left: 10px;">&lt;string&gt;<span style="color: #ffff00;"><strong>Nameit</strong></span>&lt;/string&gt;</span><br />
&lt;/dict&gt;<br />
&lt;/plist&gt;</div>
<p><span style="color: #ffff00;"><strong>name</strong></span> corresponds to the name of your project from earlier.  Under &lt;key&gt;File&lt;/key&gt;, we specify the <span style="color: #ffff00;"><strong>name </strong></span>of the script file that will be called each time <span style="color: #ffff00;"><strong>%_name</strong></span> is called.  Of course, you can change any of these.  It is also possible to create more callable scripts by copying and pasting.</p>
<p>Now enter the <em>Resources</em> folder.  Create a file called <span style="color: #ffff00;"><strong>name</strong></span>, or whatever you may have changed <strong><span style="color: #ffff00;">name</span> </strong>to, with the file extension <em>.scpt.</em> You can either use your favorite text editor or the Script Editor.  This is where we will create our actual script that displays the data.</p>
<p>The following script has the following sample output:</p>
<p>Reading and listening to You Are The Pan<br />
By John Williams<br />
From Hook (Original Motion Picture Soundtrack).</p>
<p>The first line is shows my default action combined with the current song name.  The next lines are the artist, and the album.  If iTunes is not active, whether it is paused or not open, the default action will appear.  In the above example, the default action is Reading.  The modified script can be found by clicking <a title="Sample script" href="http://tylershome.nfshost.com/name.scpt">HERE.</a></p>
<p>The code is pretty simple to follow so I won&#8217;t go into details here.  It is very simple to add more formatting.  It is just a matter of copying and pasting.  The column names found in iTunes are pretty much the same as they are in AppleScript e.g. to access the genre of a track, just use the variable genre.  Adding more substitutions, that is adding more features like %_name, is as simple as expanding the XML tree and placing the new script files in the same directory.</p>
<p>Like always, if you plan on creating a published add-on, be sure to adhere to any current standards.  And that&#8217;s it.  Just click on name.AdiumScripts to install.<br />
<em><span style="text-decoration: underline;"><span style="color: #ff0000;"><br />
Your files will be installed in Library/Application Support/Adium 2.0/Scripts</span></span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/creating-adium-scripts-itunes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating Adium Scripts (Random Text)</title>
		<link>http://www.tylerclemons.com/creating-adium-scripts-random-text/</link>
		<comments>http://www.tylerclemons.com/creating-adium-scripts-random-text/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 01:16:43 +0000</pubDate>
		<dc:creator>Tyler</dc:creator>
				<category><![CDATA[Adium]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://tylershome.nfshost.com/?p=38</guid>
		<description><![CDATA[Adium is a free mesenger client for the Mac OS X.  It allows users to connect to multiple chat services, such as AIM and ICQ, at once.  It is open source, which means users are allowed to tinker with it as they see fit.  With this extensibility, it becomes possible to type something like &#8220;/random&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Adium" href="http://www.adiumx.com/" target="_blank">Adium</a> is a free mesenger client for the Mac OS X.  It allows users to connect to multiple chat services, such as AIM and ICQ, at once.  It is open source, which means users are allowed to tinker with it as they see fit.  With this extensibility, it becomes possible to type something like <em>&#8220;/random&#8221; </em>and generate a random message.  I decided to take a quick look at what goes on under the hood and decided to give a go at creating some easy scripts.</p>
<p><span id="more-18"></span></p>
<p>One of the easiest ways to learn how to create an Adium script is to open up an exisiting script and look at how it works.  Easy enough.  First, we need to setup a file structure.  Create a folder called <strong>random.AdiumScripts</strong>.  Then right click(CTLR+click), and click &#8217;show package contents.&#8217;  Create a folder called <strong>Contents</strong>.  Inside Contents, create a folder called <strong>Resources</strong>.  The result:</p>
<p>-&gt;random.AdiumScripts<br />
&#8211;&gt;Contents<br />
&#8212;-&gt;Resources</p>
<p>The next step is to create the actual script.  Enter the Resources folder.  Open up the Script Editor from the Applications folder.  If this is not installed, then just be prepared to save a file using the <em>.scpt</em> extension.  Create a function like this:</p>
<div id="codebox" style="overflow: auto; "><code><br />
<span style="color: #0000ff;">on</span> <span style="color: #008000;">substitute()</span><br />
<span style="padding-left: 10px;"><span style="color: #0000ff;">set</span> <span style="color: #ff0000;">usethis</span> <span style="color: #0000ff;">to some</span> <span style="color: #000080;">item</span> <span style="color: #0000ff;">of </span>{"A","B, "C"}</span><br />
<span style="padding-left: 10px;"><span style="color: #0000ff;">return</span> "Random Line :   " &amp; <span style="color: #ff0000;">usethis</span></span><br />
<span style="color: #0000ff;">end</span> <span style="color: #008000;">substitute</span><br />
</code></div>
<p>The <em>on substitute() </em>function will be called every time the script is used.  Inside is an array of strings seperated by commas.  usethis is assigned to some random string inside the array and returned to Adium.  Now the question is, how do we use the script?</p>
<p>Go up one level back to the Contents folder.  Click <a title="Info.plist" href="http://tylershome.nfshost.com/info.plist.zip" target="_blank">HERE</a> and drag the info.plist file into the directory.  If you changed any of the defaults, make the appropriate changes.</p>
<p>And that&#8217;s it.  Just click on the random.AdiumScripts icon and it should install.  Type<em> /random</em> in a chatbox to test the script.  That&#8217;s the simplest way to do it.  There are some other XML properties that can be added but aren&#8217;t necessary for personal use.  If you plan on publishing on Adium&#8217;s website, be sure to add any and all public standards.</p>
<p>You can add more substitutions by creating more script files and more entries into the XML tree.  You can also edit the triggers by changing <em>/random</em> to any character sequence.</p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><em>Your files will be installed in Library/Application Support/Adium 2.0/Scripts</em></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerclemons.com/creating-adium-scripts-random-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
