<?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>John Kramlich - St. Louis Web Developer</title>
	<atom:link href="http://www.johnkramlich.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnkramlich.com/blog</link>
	<description>Thoughts on LAMP</description>
	<lastBuildDate>Wed, 09 Nov 2011 23:42:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Launch NetBeans when opening files in the MacOS X Finder</title>
		<link>http://www.johnkramlich.com/blog/2011/06/01/launch-netbeans-when-opening-files-in-the-finder/</link>
		<comments>http://www.johnkramlich.com/blog/2011/06/01/launch-netbeans-when-opening-files-in-the-finder/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 21:01:05 +0000</pubDate>
		<dc:creator>jkramlich</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.johnkramlich.com/blog/?p=39</guid>
		<description><![CDATA[I recently switched from Open Komodo to NetBeans 7. What drove me absolutely nuts was the fact that I couldn&#8217;t drag and drop files onto the NetBeans application to have them open. Further complicating the issue, NetBeans does not use a standard file browser dialog so you cannot drag and drop onto that either. Here [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched from <a href="http://www.openkomodo.com/">Open Komodo</a> to <a href="http://netbeans.org/">NetBeans 7.</a>  What drove me absolutely nuts was the fact that I couldn&#8217;t drag and drop files onto the NetBeans application to have them open.  Further complicating the issue, NetBeans does not use a standard file browser dialog so you cannot drag and drop onto that either. </p>
<p>Here is my work around. It allows you to drag and drop a single file, or group of files and have them open in NetBeans.  I created an application with AppleScript that takes the dropped files and passes them to a shell command that opens netbeans.  To use this you must first have NetBeans already launched.  I keep this application sitting in my Dock right next the NetBeans icon.</p>
<p><strong>You may need to edit the path to NetBeans if you are using a different version or location</strong></p>
<h2>The AppleScript</h2>
<pre class="brush: applescript; title: ; notranslate">
-- This AppleScript created by John Kramlich of http://www.johnkramlich.com
-- Modify it in anyway you see fit.
return -- not needed, but shows that the script stops here when &quot;run&quot;

on open of finderObjects -- &quot;open&quot; handler triggered by drag'n'drop launches
	repeat with i in (finderObjects) -- in case multiple objects dropped on applet

		set mypath to posix_path(i)

		do shell script &quot;/Applications/NetBeans/NetBeans\\ 7.0.app/Contents/MacOS/netbeans --open &quot; &amp; mypath

	end repeat

	tell application &quot;NetBeans 7.0&quot;
		activate
	end tell

end open

on posix_path(mac_path)
	set mac_path to (mac_path as text)
	set root to (offset of &quot;:&quot; in mac_path)
	set rootdisk to (characters 1 thru (root - 1) of mac_path)
	tell application &quot;Finder&quot;
		if (disk (rootdisk as string) is the startup disk) then
			set unixpath to &quot;/&quot; &amp; (characters (root + 1) thru end of mac_path)
		else
			set unixpath to &quot;/Volumes:&quot; &amp; mac_path
		end if
	end tell
	set chars to every character of unixpath
	repeat with i from 2 to length of chars
		if item i of chars as text is equal to &quot;/&quot; then
			set item i of chars to &quot;:&quot;
		else if item i of chars as text is equal to &quot;:&quot; then
			set item i of chars to &quot;/&quot;
		else if item i of chars as text is equal to &quot;'&quot; then
			set item i of chars to &quot;\\'&quot;
		else if item i of chars as text is equal to &quot;\&quot;&quot; then
			set item i of chars to &quot;\\&quot; &amp; &quot;\&quot;&quot;
		else if item i of chars as text is equal to &quot;*&quot; then
			set item i of chars to &quot;\\*&quot;
		else if item i of chars as text is equal to &quot;?&quot; then
			set item i of chars to &quot;\\?&quot;
		else if item i of chars as text is equal to &quot; &quot; then
			set item i of chars to &quot;\\ &quot;
		else if item i of chars as text is equal to &quot;\\&quot; then
			set item i of chars to &quot;\\\\&quot;
		end if
	end repeat
	return every item of chars as string
end posix_path
</pre>
<h2>The Icon</h2>
<p><a href="http://www.johnkramlich.com/blog/wp-content/uploads/2011/06/OpenWithNetBeans.png"><img src="http://www.johnkramlich.com/blog/wp-content/uploads/2011/06/OpenWithNetBeans.png" alt="" title="OpenWithNetBeans" width="128" height="128" class="aligncenter size-full wp-image-50" /></a></p>
<h2>Download the Files</h2>
<ul>
<li><a href='http://www.johnkramlich.com/blog/wp-content/uploads/2011/06/Open-in-Netbeans.zip'>Full Application with Icon</a></li>
<li><a href='http://www.johnkramlich.com/blog/wp-content/uploads/2011/06/Open-in-Netbeans-Source.zip'>AppleScript Source Code</a></li>
<li><a href='http://www.johnkramlich.com/blog/wp-content/uploads/2011/06/OpenInNetbeans.icns_.zip'>Mac ICNS Icon file</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.johnkramlich.com/blog/2011/06/01/launch-netbeans-when-opening-files-in-the-finder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Batch Exporting Adobe Flash FLAs to QuickTime Movies</title>
		<link>http://www.johnkramlich.com/blog/2011/05/24/batch-exporting-adobe-flash-flas-to-quicktime-movies/</link>
		<comments>http://www.johnkramlich.com/blog/2011/05/24/batch-exporting-adobe-flash-flas-to-quicktime-movies/#comments</comments>
		<pubDate>Tue, 24 May 2011 07:54:18 +0000</pubDate>
		<dc:creator>jkramlich</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[FLA]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[JSFL]]></category>
		<category><![CDATA[quicktime]]></category>
		<category><![CDATA[SWF]]></category>

		<guid isPermaLink="false">http://blog.johnkramlich.com/?p=6</guid>
		<description><![CDATA[I worked on a project with 170 Adobe Flash videos which were published as SWF files.  These files were published prior to FLV becoming the norm, so all video and audio was contained within a each individual SWF.  Programs such as Sothink&#8217;s SWF to Video Converter produced output files that had many audio sync issues. [...]]]></description>
			<content:encoded><![CDATA[<p>I worked on a project with 170 Adobe Flash videos which were published as SWF files.  These files were published prior to FLV becoming the norm, so all video and audio was contained within a each individual SWF.  Programs such as <a href="https://secure.avangate.com/order/product.php?PRODS=1180719&amp;QTY=1&amp;AFFILIATE=26818">Sothink&#8217;s SWF to Video Converter</a> produced output files that had many audio sync issues.</p>
<p>JSFL alone does not allow exporting to QuickTime movies.  The solution was to use a combination of <a href="https://secure.avangate.com/affiliate.php?ACCOUNT=SOUTSO&amp;AFFILIATE=26818&amp;PATH=http%3A%2F%2Fwww.sothinkmedia.com">Sothink SWF Decompiler</a>, <a href="http://www.adobe.com/devnet/flash/articles/jsapi.html" target="_blank">JSFL</a>, <a href="http://www.macosxautomation.com/automator/" target="_blank">Automator</a> for MacOSX and <a href="http://en.wikipedia.org/wiki/AppleScript" target="_blank">AppleScript</a>.</p>
<h2>Step 1: Getting the content into FLA format</h2>
<p>For this I used <a href="https://secure.avangate.com/affiliate.php?ACCOUNT=SOUTSO&amp;AFFILIATE=26818&amp;PATH=http%3A%2F%2Fwww.sothinkmedia.com">Sothink SWF Decompiler</a>.  It is available for both Windows and MacOS X.  In this instance I actually used the Windows version because I had a license for it.  Both Mac and Windows versions should have the option to batch an entire folder of SWF files and convert them into FLA.</p>
<h2>Step 2: Setting a publish profile</h2>
<p>Unfortunately, the publish profile of the decompiled FLA&#8217;s was a bit off.  There may be other ways to modify the default publish profile but I found a <a href="http://gskinner.com/blog/archives/2004/08/jsfl_fla_batch.html">neat JSFL script</a> from <a href="http://gskinner.com/">Grant Skinner</a> to batch publish Flash files. I was able to modify it so that it imported a publish profile and then saved the resulting Flash file.  These files were then used for the next batch.  <a href="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/SavePublishSettingsJSFL.zip">My modifications to his script can be found here</a>.</p>
<h2>Step 3: Use MacOS X Automator and AppleScript to export to QuickTime</h2>
<p>Apple&#8217;s Automator introduced a great new feature titled &#8220;Watch Me Do&#8221;.  It&#8217;s intended to watch you interact with the keyboard and mouse and then be able to play back those actions. The trouble is, it doesn&#8217;t capture everything you do.  For everything that it doesn&#8217;t capture, we will use AppleScript to fill in the blanks.</p>
<p>Open Automator and create a new Workflow.  Now, launch Adobe Flash and open a few files to work with.  You will need at least 3 files to test the batch capabilities.  Go back into Automator and click the <strong>Record</strong> button.  Go back into Flash and Select <strong>File &gt; Export &gt; Export Movie&#8230;</strong></p>
<p>Pick a directory you would like the result to go into and use the default name Flash suggests (If you need to rename the files later I suggest A Better Finder Rename). Click Save and you&#8217;ll be presented with the QuickTime Export Settings window like this:</p>
<p style="text-align: center;"><a href="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/Screen-shot-2011-05-23-at-11.52.16-PM.png"><img class="aligncenter size-full wp-image-23" title="QuickTime Export Settings for Flash" src="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/Screen-shot-2011-05-23-at-11.52.16-PM.png" alt="" /></a>Flash will remember the Export settings and use them for the next file you export.  Make sure you have them set properly and click <strong>Export</strong>.</p>
<p>Your movie will begin exporting.  Depending on the complexity it could take awhile.  Keep an eye on the clock, you&#8217;ll want to know about how long it takes to export your files.</p>
<p>When the export is complete you&#8217;ll see a dialog like this:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-17" title="Screen shot 2011-05-23 at 11.15.16 PM" src="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/Screen-shot-2011-05-23-at-11.15.16-PM1.png" alt="" width="574" height="235" /></p>
<p>Automator cannot dimiss this dialog with &#8220;Watch Me Do&#8221;.  You will need to add a bit of AppleScript to make that work.  You can download <a href="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/BatchExportFlashFiles.zip">my Automator workflow</a>, with the needed AppleScript <a href="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/BatchExportFlashFiles.zip">here</a>.  Please note that you will need to adjust the duration that the workflow pauses for during export.  Many of my movies exported in just under a minute so I set the duration to 2 minutes just to be sure everything would finish before AppleScript attempted to dismiss the confirmation dialog.</p>
<p>Files:</p>
<ul>
<li><a href="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/BatchExportFlashFiles.zip">Batch Export Flash Files Automator Workflow</a></li>
<li><a href="http://www.johnkramlich.com/blog/wp-content/uploads/2011/05/SavePublishSettingsJSFL.zip">Save Publish Settings JSFL</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.johnkramlich.com/blog/2011/05/24/batch-exporting-adobe-flash-flas-to-quicktime-movies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

