<?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>James Badger's Personal Site &#187; Cocoa</title>
	<atom:link href="http://jamesbadger.ca/category/development/cocoa/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesbadger.ca</link>
	<description></description>
	<lastBuildDate>Sat, 13 Jun 2009 23:59:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Play Sound</title>
		<link>http://jamesbadger.ca/2005/11/16/20/</link>
		<comments>http://jamesbadger.ca/2005/11/16/20/#comments</comments>
		<pubDate>Wed, 16 Nov 2005 06:47:46 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://jamesbadger.ca/?page_id=20</guid>
		<description><![CDATA[Version 1.0 &#8211; Nov 15/05

Play Sound is an Automator action that simply tries to play any sound file passed into it. Learn more about Automator

It will accept a list of files, and only play audio files of types AIFF, M4A, MPEG (MP3), WAV, and ULAW. I may add support for more formats in the future, [...]]]></description>
			<content:encoded><![CDATA[Version 1.0 &#8211; Nov 15/05

Play Sound is an Automator action that simply tries to play any sound file passed into it. Learn more about <a href="http://www.apple.com/macosx/features/automator/" title="Apple - Mac OS X - Automator">Automator</a>

It will accept a list of files, and only play audio files of types AIFF, M4A, MPEG (MP3), WAV, and ULAW. I may add support for more formats in the future, I wasn&#8217;t sure how it would handle trying to play a non-audio file.

<div class="download">
<h3>Download</h3>
	<p><a href="/wp-downloads/playsound10.dmg">Download Disk Image &#8211; 208KiB</a><br />
<span class="small">MD5 (playsound10.dmg) = 39fe792f5617cdacd6577489ca4f8354</span>
</div>

<h4>Requirements</h4>
A Macintosh
Mac OS X version 10.4.0 or greater

<h4>Cost</h4>
Free!

<h4>Installation</h4>
Open the disk image after downloading, and open the Installer program. You will be guided through installation. If you prefer to install the file manually, you can drag the file to the location of your choice.

<h4>Getting Started</h4>
After installing the file, open the Automator application in your Applications folder. Try to recreate the workflow below, substituting in a folder of sounds you have on your Mac. If you don&#8217;t know what to choose, try <b>/System/Library/Sounds</b>
<img src="/wp-downloads/example_workflow.png" title="A sample workflow" style="border: 1px solid #000" />

You can find the Play Sound action under the System category. If the workflow is correct, it should try to play every sound file in the directory, one after another. You can halt the program at any time by pressing Stop, which will interrupt the currently playing sound.

<h4>Known Issues</h4>
Limited to audio files of types AIFF, M4A, MPEG (MP3), WAV, and ULAW.

<h4>Version History</h4>
Play Sound Action
November 15th, 2005
- First Release]]></content:encoded>
			<wfw:commentRss>http://jamesbadger.ca/2005/11/16/20/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets &amp; Actions</title>
		<link>http://jamesbadger.ca/2005/11/09/widgets-actions/</link>
		<comments>http://jamesbadger.ca/2005/11/09/widgets-actions/#comments</comments>
		<pubDate>Wed, 09 Nov 2005 22:42:18 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://jamesbadger.ca/?p=17</guid>
		<description><![CDATA[I have the &#8220;Play Sound&#8221; Action ready, but actions don&#8217;t have the same type of ease of installation that is found with screen savers, where double-clicking it will install it (either in the user&#8217;s folder, or in the main library folder). So I wrote a small installation program to handle this, hopefully it is lightweight [...]]]></description>
			<content:encoded><![CDATA[I have the &#8220;Play Sound&#8221; Action ready, but actions don&#8217;t have the same type of ease of installation that is found with screen savers, where double-clicking it will install it (either in the user&#8217;s folder, or in the main library folder). So I wrote a small installation program to handle this, hopefully it is lightweight enough to make it easy for any user, and look nice too. I went for Applescript Studio for the installer (I thought it would be faster to develop), but it makes me appreciate the advantages of Cocoa more, I think.

Also developing a widget. Or two. Both powered by PHP, because a) it&#8217;s installed on Tiger, and b) it&#8217;s really easy to write with. Maybe I&#8217;ll convert them to Cocoa or something later (Cocoa is fast!), but I really want to get some feedback on them.


<a href="http://developer.apple.com/macosx/automator.html" title="Apple Developer: Working with Automator">Working with Automator</a><br />
]]></content:encoded>
			<wfw:commentRss>http://jamesbadger.ca/2005/11/09/widgets-actions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Automator Action</title>
		<link>http://jamesbadger.ca/2005/10/27/automator-action/</link>
		<comments>http://jamesbadger.ca/2005/10/27/automator-action/#comments</comments>
		<pubDate>Fri, 28 Oct 2005 03:47:06 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://jamesbadger.ca/?p=14</guid>
		<description><![CDATA[Today, I created an automator workflow to cleanup my desktop. I wanted it to run silently in the background, and then give an audible notification of success. I had the option of just doing a simple beep using an AppleScript action, but my alert sound is somewhat boring. So instead, I&#8217;ll use an action to [...]]]></description>
			<content:encoded><![CDATA[Today, I created an automator workflow to cleanup my desktop. I wanted it to run silently in the background, and then give an audible notification of success. I had the option of just doing a simple beep using an AppleScript action, but my alert sound is somewhat boring. So instead, I&#8217;ll use an action to play a sound file. Well, there isn&#8217;t an action that comes with Automator that does this, without opening another application to play it (iTunes, Quicktime).

Well, doing a search of the web turned up no results, so I decided to create my own action using XCode.

<span id="more-14"></span>

After an hour or so of fiddling around and recalling how to use Cocoa, I created an Automator action to play sounds files that are passed to it.

<img src="/wp-downloads/example_workflow.png" title="A sample workflow" style="border: 1px solid #000" />

It will only play files with type codes &#8216;AIFF&#8217;, &#8216;M4A &#8216;, &#8216;MPEG&#8217;, &#8216;.WAV&#8217;, and &#8216;ULAW&#8217;; and files that contain &#8220;.mp3&#8243;, &#8220;.m4a&#8221;, &#8220;.wav&#8221;, &#8220;.au&#8221;, and &#8220;.aif&#8221;. I think that should be safe enough, but I&#8217;m sure there is a better solution. I also need to set the output to &#8220;Anything&#8221;, because nothing is actually returned.

Expect to see it available for download in the next few days. Yeah, you can bug me if I don&#8217;t follow up on it!


If you&#8217;re looking for more information on Automator, refer to these links.
<a href="http://www.apple.com/macosx/features/automator/" title="Apple - Tiger's Automator">Automator at Apple</a>
<a href="http://www.automatoractions.com/" title ="Automator Actions At Mac Scripter">Automator Actions</a>
<a href="http://www.automatorworld.com/" title ="Steve Weintraub's Automator World">Automator World</a>

<a href="http://developer.apple.com/macosx/automator.html" title="Create your own Actions">Developer Connection &#8211; Working with Automator</a>]]></content:encoded>
			<wfw:commentRss>http://jamesbadger.ca/2005/10/27/automator-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
