<?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>Ajar Productions &#187; ExtendScript</title>
	<atom:link href="http://ajarproductions.com/blog/category/extendscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://ajarproductions.com/blog</link>
	<description>Animation &#124; Design &#124; Development</description>
	<lastBuildDate>Mon, 09 Jan 2012 17:30:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>MergeTextFrame for InDesign has new features!</title>
		<link>http://ajarproductions.com/blog/2010/04/03/mergetextframe-for-indesign-has-new-features/</link>
		<comments>http://ajarproductions.com/blog/2010/04/03/mergetextframe-for-indesign-has-new-features/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 03:48:36 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[ExtendScript]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[InDesign]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=521</guid>
		<description><![CDATA[Version 1.1.0 now has the ability to batch-merge textframes within every page of the current document. I had several requests for something like this (including from a recent donor). Here it is! The download links above have been updated. The new version now has the &#8220;Apply to&#8221; and &#8220;Ignore locked layers&#8221; as shown in the [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.1.0 now has the ability to batch-merge textframes within  every page of the current document. I had several requests for something  like this (including from a recent donor). Here it is! The download  links above have been updated.</p>
<p>The new version now has the &#8220;Apply  to&#8221; and &#8220;Ignore locked layers&#8221; as shown in the image below.</p>
<p><a href="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_v110_features.gif"><img title="Merge Textframes version 1.1.0 new features" src="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_v110_features.gif" alt="Merge Textframes version 1.1.0 new features" width="412" height="224" /></a></p>
<p>Note that any warning messages about having too few textframes  selected have been delayed until after the dialog box appears to reflect  the new options.</p>
<p>Downloads of the new version are available on the <a href="http://ajarproductions.com/blog/2008/11/28/merge-textframes-extension-for-adobe-indesign/">original post</a>.</p>
<p>Want a good way to move your extension request to the top of the list?</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="1624290">
<input id="donate_btn" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" type="image" />
</form>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2010/04/03/mergetextframe-for-indesign-has-new-features/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Hacking the Flash CS4 Motion Model to Create New Extensions</title>
		<link>http://ajarproductions.com/blog/2009/03/04/hacking-the-flash-cs4-motion-model-to-create-extensions/</link>
		<comments>http://ajarproductions.com/blog/2009/03/04/hacking-the-flash-cs4-motion-model-to-create-extensions/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 02:03:43 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ExtendScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[jsfl]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[tween]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=337</guid>
		<description><![CDATA[This JSFL technique can be used in Flash CS4 in lieu of the non-existent timeline.createMotionObjectTween() command. I refer to this as a "hack" because it's an unsupported method, but given the complexity of what can be created with this new motion model, editing the XML is actually a fairly efficient way to go about creating/editing a tween. I used this technique to create the EaseCaddy, MotionSketch, and MotionBlur extensions.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quote from an email I sent to <a href="http://keyframer.com/" target="_blank">Chris Georgenes</a> and <a href="http://quip.net" target="_blank">David Stiller</a> on 9/29/08 about an extension idea that I had using the new motion tweens in Flash CS4 (before I&#8217;d even used the application):</p>
<blockquote><p>Given that the new motion tween creates a bezier path, I&#8217;m guessing that we&#8217;ll have access to creating such a path with JSFL. Which led me to think about creating that path in real-time, similar to the real-time drawing that I&#8217;d seen from <a href="http://www.keyframer.com/index.php/2007/07/05/scribblebot/" target="_blank">ScribbleBot</a> on Chris&#8217;s blog. Instead of scribbling a line in real-time, I&#8217;d be sketching a motion path. There would be a variable to determine &#8220;smoothness&#8221; so that it doesn&#8217;t create an unmananageable amount of new motion keyframes. And it could probably be done with a custom tool rather than a panel, so that the sketching could be done directly on the stage.</p>
<p>That also leads me to wonder if there&#8217;s a way to record the armature animation in real-time and convert it to a motion tween, similar to the feature that already exists in After Effects CS3.</p></blockquote>
<p>I know, I&#8217;m a nerd. The first idea there became <a href="http://ajarproductions.com/blog/2009/02/10/flash-extension-motionsketch/">MotionSketch</a>. I haven&#8217;t yet found a way to accomplish the second idea with the armature, but I have a few ideas.</p>
<p>Prior to the release of Flash CS4, I had gotten a little hooked on creating Flash extensions. It&#8217;s quite easy to create a classic motion tween with JSFL (Flash Javascript), you can simply make the following call: <em>timeline.createMotionTween()</em>. It was likely that <em>createMotionTween() </em>would remain for legacy support even though the name of the tween had changed from &#8220;motion&#8221; to &#8220;classic.&#8221; I&#8217;d seen all of the great <a href="http://flashthusiast.com/2008/09/22/the-new-way-of-tweening-in-flash-cs4-or-new-motion-in-flash-cs4-makes-your-animations-better-faster-stronger/" target="_blank">new motion features</a> demonstrated online, and I expected there might be an equivalent call for a new motion tween.  When Lee Brimelow <a href="http://theflashblog.com/?p=448" target="_blank">linked to the CS4 documentation</a>, I went right to the <a href="http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/index.html" target="_blank">Extending Flash</a> section to see what had been added. I didn&#8217;t see any additions for the motion features, but I had also previously seen <a href="http://theflashblog.com/?p=445" target="_blank">Lee&#8217;s post</a> on <a href="http://www.flashcamp.org/" target="_blank">Flash Camp</a> in San Francisco. Fortunately, I live close to San Francisco and I decided to head over try out the application early, and maybe get a chance to talk with some of the Flash team about any undocumented features.</p>
<p>While at Flash Camp, I spoke with <a href="http://blogs.adobe.com/rgalvan/" target="_blank">Richard Galvan</a> and he directed me to John Mayhew, the engineer behind the new motion model in Flash. John was very affable and willing to follow up with me, but he didn&#8217;t know of any undocumented features offhand. Unfortunately, adding features to the JSFL API is usually somewhat of an afterthought because so much of the development time is spent on the new features themselves. I had a few ideas to use the new 3D features while at Flash Camp as well, but they were similarly left out of the JSFL API.</p>
<p>So I let those ideas go for awhile and focused on a <a href="http://ajarproductions.com/blog/2008/10/12/flash-extension-combine-textfields/">different extension</a> as my Flash Camp project. A few weeks later, I got a little antsy and I starting digging around in the Flash configuration directory for clues. I noticed two files in the Javascript directory named <em>MotionXML.jsfl</em> and <em>MotionClipboard.xml</em>. I started looking around in the JSFL file for undocumented commands that I could use, but to little avail. I think I even put some trace calls into the JSFL to spit out info when copying motion from the Flash IDE. I noticed that even though copying and pasting a new motion tween appeared to work the same way in the Flash interface as copying and pasting a classic tween, a new motion tween was not triggering the calls in the JSFL file. Looking at the XML file, I found that even though copying a motion tween wasn&#8217;t using the same JSFL calls, it was saving XML to the same file&#8230;just different XML. The classic tweens were generating XML with a root tag of <em>&lt;Motion&gt;</em> and the new tweens were generating a root tag of <em>&lt;AnimationCore&gt;</em>.</p>
<p>Flash seemed to be able to discern which type of motion it was copying or pasting and acting accordingly. So it occurred to me that I could grab the data from the motion clipboard and alter it before pasting it back. Additionally, if I wanted data from an existing tween, I could run a Copy Motion command, available to JSFL as of Flash CS3 thanks to Robert Penner&#8217;s <a href="http://robertpenner.com/flashblog/2007/08/links-for-copy-motion-as-actionscript-3_10.html" target="_blank">Copy Motion feature</a>, then go about altering and pasting. These are the extensions that I&#8217;ve created thus far using that very technique:</p>
<ul>
<li><a href="http://ajarproductions.com/blog/2009/02/26/the-missing-flash-panel-easecaddy/">EaseCaddy</a></li>
<li><a href="http://ajarproductions.com/blog/2009/02/10/flash-extension-motionsketch/">MotionSketch</a></li>
<li><a href="http://ajarproductions.com/blog/2009/03/02/new-flash-extension-motionblur/">MotionBlur</a></li>
</ul>
<p>Below is a rundown of the steps I used in the extensions mentioned above. This technique can be used in lieu of the non-existent <em>timeline.createMotionObjectTween()</em> command. I refer to this as a &#8220;<a href="http://en.wikipedia.org/wiki/Hack_(technology)" target="_blank">hack</a>&#8221; because it&#8217;s an unsupported method, but given the complexity of what can be created with this new motion model, editing the XML is actually a fairly efficient way to go about creating/editing a tween. If the XML is not properly formed, it can cause Flash to crash when you try to paste the motion, or it can create some funky bugs in the Motion Editor. Be sure to test your code thoroughly before releasing anything for public consumption.  The language is <a href="http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7fe8.html" target="_blank">JSFL</a> (used to automate and manipulate the Flash authoring environment). There&#8217;s a link to documentation for the AnimationCore XML listed in step 3.</p>
<p><span id="more-337"></span></p>
<p><strong>Step 1:</strong> Store the motion clipboard so you can restore it when you&#8217;re done. In some cases, I store it as a file. In this example, I store it as a variable.</p>
<p><code>var MOTION_CLIPBOARD = fl.configURI + "Javascript/MotionClipboard.xml";<br />
var tl = fl.getDocumentDOM().getTimeline();<br />
var storedMotion = FLfile.read(MOTION_CLIPBOARD);</code></p>
<p><strong>Step 2(a):</strong> Copy motion to clipboard, retrieve the new clipboard contents and convert to XML. Use this step if you want alter an existing motion tween. The <a href="http://ajarproductions.com/blog/2009/02/28/new-flash-extension-motionblur/">MotionBlur</a> extension uses this step.</p>
<p><code>tl.copyMotion();<br />
var xmlstr = FLfile.read(MOTION_CLIPBOARD);<br />
var motionXML = new XML(xmlstr)</code></p>
<p><strong>Step 2(b)</strong>: Instead of copying the motion, you can create a new tween by loading a more or less blank motion XML template and adding content to it. The <a href="http://ajarproductions.com/blog/2009/02/10/flash-extension-motionsketch/">MotionSketch</a> extension uses this step.<a href="http://ajarproductions.com/blog/2009/02/10/flash-extension-motionsketch/"><br />
</a></p>
<p><strong>Step 3:</strong> The motion XML can then be altered using <a href="http://robertpenner.com/flashblog/2007/08/jsfl-updated-to-javascript-16-gains-e4x.html">E4X</a>. This portion of the code is different for each extension, depending on what the extension is trying to accomplish. Here&#8217;s the <a href="http://flashthusiast.com/2008/11/04/understanding-flash-cs4-motion-xml/" target="_blank">documentation on CS4 Motion XML</a> that Flash engineer John Mayhew graciously put together.</p>
<p><strong>Step 4:</strong> Write the altered XML to the motion clipboard.</p>
<p><code>FLfile.write(MOTION_CLIPBOARD, motionXML.toXMLString());</code></p>
<p><strong>Step 5:</strong> Paste the altered motion.</p>
<p><code>tl.pasteMotion();</code></p>
<p><strong>Step 6:</strong> Restore the motion clipboard for the user.</p>
<p><code>FLfile.write(MOTION_CLIPBOARD, storedMotion);</code></p>
<p>If you want to know if a motion tween has already been applied, you can retrieve the <em>tweenType</em> property from the current frame. A classic tween will return a value of &#8220;<em>motion</em>&#8221; and a new motion tween will return a value of &#8220;<em>motion object</em>&#8220;. If you use Step 2(a), you&#8217;ll want to check and make sure you have a &#8220;motion object&#8221; selected before proceeding.</p>
<p>And there you have it.</p>
<p>There are other ways to go about this process. You could, since motion presets are just motion XML files, run this process through the <a href="http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/WS6F01C4D8-31E3-4d68-BB08-2E4C116DA70E.html" target="_blank">Motion Presets panel&#8217;s JSFL calls</a>, but this would require more steps than the process laid out above.</p>
<p><b>Update (1/12/10)</b>: Flash CS5 now has direct JSFL access to the calls documented in this post. Check out this <a href="http://active.tutsplus.com/tutorials/workflow/creating-advanced-motion-presets-in-flash-with-jsfl/" target="_blank">video tutorial</a> that I produced on ActiveTuts for more info.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2009/03/04/hacking-the-flash-cs4-motion-model-to-create-extensions/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Easy (and Readable) Extendscript to JSFL Workflow</title>
		<link>http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/</link>
		<comments>http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 01:54:56 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ExtendScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[jsfl]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=214</guid>
		<description><![CDATA[Even though the original Adobe Creative Suite applications (Photoshop, Illustrator, InDesign) and the original Macromedia Studio applications (Flash, Fireworks, Dreamweaver) don&#8217;t speak the same language, they&#8217;re both versions of javascript. You can send code from Extendscript (used in PS, AI, ID) as a string to another Adobe application&#8217;s native scripting language, like Flash&#8217;s JSFL scripting [...]]]></description>
			<content:encoded><![CDATA[<p>Even though the original Adobe Creative Suite applications (Photoshop, Illustrator, InDesign) and the original Macromedia Studio applications (Flash, Fireworks, Dreamweaver) don&#8217;t speak the same language, they&#8217;re both versions of javascript. You can send code from Extendscript (used in PS, AI, ID) as a string to another Adobe application&#8217;s native scripting language, like Flash&#8217;s JSFL scripting language. The process of creating these strings is much like sending JSFL from Actionscript, long code strings have to be created. String assignments don&#8217;t take kindly to hard returns, so to make this code readable, the string containing the script can be broken into lines by appending using the <em>+=</em> operator, similar to this pseudocode:</p>
<p><code>var codeString = "function myFunction() {";<br />
codeString += "var myVar = 10;";<br />
codeString += "for(var i=0; i &lt; myVar; i++){";<br />
codeString += " var newVar = i;";<br />
codeString += "}";<br />
codeString += "}";<br />
sendStringToOtherLanguage(codeString);</code></p>
<p>While this is more readable than one string of text, it&#8217;s still a pain to edit. All code highlighting is lost. On top of that, you&#8217;re debugging across languages, so it slows testing even more. While working on a script recently I discovered a workflow that allows me to maintain code readability while working across multiple Adobe applications.<br />
<span id="more-214"></span><br />
The solution came to me after discovering the <em>toSource()</em> javascript method.</p>
<p>You can download the example script in its entirety <a href="http://ajarproductions.com/blog/wp-content/uploads/2008/12/extendscript-to-jsfl.jsx">here</a>.</p>
<p>This can be run from any Extendscript-enabled application (Illustrator, InDesign, Photoshop, Soundbooth, After Effects, or Bridge) and sent to any other application available to BridgeTalk (Contribute, Fireworks, Acrobat, Dreamweaver, Flash, Acrobat, <em>etc</em>).</p>
<p>You can set the source application by putting the script in the appropriate directory and running the script directly from the application or use the Extendscript Toolkit and select the application name from the drop-down at the top.</p>
<p>The breakdown is as follows&#8230;</p>
<p>I set the target application. In this case I&#8217;m targeting JSFL in Flash:</p>
<p><code>var targAppName = "Flash";<br />
var sourceApp = BridgeTalk.getDisplayName(BridgeTalk.appName);<br />
var targApp = getTargetAppName(targAppName);<br />
var targAppStatus = BridgeTalk.getStatus(targApp);<br />
var layerName = "layer created from " + sourceApp;</code></p>
<p>The following function is referenced above. It uses the <em>targAppName</em> variable to search for any open version of that application. It checks more recent versions of the application first. So if you have Flash CS4 and Flash CS3 open, it will find and return Flash CS4.</p>
<p><code>function getTargetAppName(nameStr){<br />
//assumes higher versions are listed last<br />
nameStr = nameStr.toLowerCase();<br />
for(var i=apps.length-1; i&gt;0; i--) {<br />
if(apps[i].toLowerCase().indexOf(nameStr) != -1) {<br />
if(BridgeTalk.getStatus(apps[i]) == "IDLE"<br />
|| BridgeTalk.getStatus(apps[i]) == "BUSY"<br />
|| BridgeTalk.getStatus(apps[i]) == "PUMPING"<br />
&amp;&amp; BridgeTalk.getStatus(apps[i]) != "ISNOTRUNNING"){<br />
//this version of the app is open<br />
return apps[i];<br />
}<br />
}<br />
}<br />
return nameStr;<br />
}</code></p>
<p>The <em>stringifyFunction() </em>function below takes a reference to another function, converts that function&#8217;s contents to a string using the <em>toSource()</em> method. The string returned from <em>toSource()</em> is encapsulated in parentheses, so those are removed before the string is returned.</p>
<p><code>function stringifyFunction(func){<br />
var str = func.toSource();<br />
var rStr = str.substring(1, str.length-1) + "\r";<br />
return rStr;<br />
}</code></p>
<p>The <em>runTargetFunction</em> is where I reference my JSFL functions (just one in this example). Instead of typing out each line of the function and appending it to a string I can call my <em>stringifyFunction() </em>method and pass my JSFL function (listed further down). Then I append my call to said function as a string, <em>newLayer()</em> in this case, and send it to my target application (Flash) using BridgeTalk. I also have some error checking with alerts to make sure the application is running and available.</p>
<p><code>function runTargetFunction(layerName){<br />
if(targAppStatus == "IDLE"){<br />
var bt = new BridgeTalk();<br />
bt.target = targApp;<br />
var scriptStr = stringifyFunction(newLayer);<br />
scriptStr += "newLayer('" + layerName + "');";<br />
bt.body = scriptStr;<br />
bt.send();<br />
BridgeTalk.bringToFront(targApp);<br />
}<br />
else if (targAppStatus == "ISNOTRUNNING" || targAppStatus == "ISNOTINSTALLED"){<br />
alert(targAppName + " must be running for this script to work."); }<br />
else if(targAppStatus == "BUSY" ) {<br />
alert(targAppName + " is currently busy. Check the application to make sure no dialog boxes are open."); }<br />
else { alert("There was an error when trying to interface with the " + targAppName + " application."); }</code></p>
<p>}</p>
<p>Next I run the function:</p>
<p><code>runTargetFunction(layerName);</code></p>
<p>Below my Extendscript functions, I list my JSFL functions just as if they were Extendscript. The Extendscript Toolkit is pretty forgiving and doesn&#8217;t mind that I have functions in different javascript dialects, so long as I don&#8217;t call the function directly from Extendscript. This script below is JSFL code that creates a new layer in Flash. If you have Flash open, but don&#8217;t have a document open, the script will open a new Flash document before creating the layer.</p>
<p><code>function newLayer(layerName) {<br />
if(fl.documents.length &lt; 1) fl.createDocument();<br />
var layer = fl.getDocumentDOM().getTimeline().addNewLayer(layerName);<br />
}</code></p>
<p>The layer created in Flash will list the application that sent the code. So if you ran this script from Photoshop CS3, the layer would be titled, &#8220;layer created from Photoshop CS3.&#8221;</p>
<p>I purposely wrote this example so that it would be easy to use with other applications. If you want to target a different application, change the functions at the bottom to work in another application (like Dreamweaver or Fireworks) using the application&#8217;s native JS and update the <em>targAppName</em> at the top. Keep in mind that communicating to most of these applications will only work in CS3 and later (post Adobe and Macromedia merger).</p>
<p>You can then write as many functions as you like for your target application and they&#8217;ll still be readable (just make sure to add them and call them in the string within <em>runTargetFunction</em>).</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/12/14/easy-and-readable-extendscript-to-jsfl-workflow/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New Extension: Send Colors from InDesign and Illustrator to Flash</title>
		<link>http://ajarproductions.com/blog/2008/12/05/send-colors-from-indesign-and-illustrator-to-flash/</link>
		<comments>http://ajarproductions.com/blog/2008/12/05/send-colors-from-indesign-and-illustrator-to-flash/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 22:27:37 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[ExtendScript]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[InDesign]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[BridgeTalk]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[jsfl]]></category>
		<category><![CDATA[swatches]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=188</guid>
		<description><![CDATA[Following the merge text extensions for Flash, Illustrator, and InDesign, Keith Gilbert wrote me wondering about getting swatch information from InDesign to Flash via XFL or by way of importing an Adobe Swatch Exchange (ASE) file into the Flash swatches panel. There are several stumbling blocks in the way of such an extension. First, finding [...]]]></description>
			<content:encoded><![CDATA[<p>Following the merge text extensions for <a href="http://ajarproductions.com/blog/2008/10/12/flash-extension-combine-textfields/">Flash</a>, <a href="http://ajarproductions.com/blog/2008/11/23/merge-text-extension-for-illustrator/">Illustrator</a>, and <a href="http://ajarproductions.com/blog/2008/11/28/merge-textframes-extension-for-adobe-indesign/">InDesign</a>, <a href="http://blog.gilbertconsulting.com/" target="_blank">Keith Gilbert</a> wrote me wondering about getting swatch information from InDesign to Flash via XFL or by way of importing an Adobe Swatch Exchange (ASE) file into the Flash swatches panel. There are several stumbling blocks in the way of such an extension. First, finding a way for extendscript or JSFL to read the contents of an ASE file (which is not open source and not plaintext) proves to be quite difficult. Second, JSFL (the Flash scripting language) doesn&#8217;t have any access (currently) to the swatches panel.</p>
<p>&#8212;<br />
<strong>BREAKING NEWS (12/6/08)</strong>: I noticed that the <a href="http://www.keyframer.com/index.php/flash/#more-184" target="_blank">new Kuler extension</a> for Flash CS4 has an &#8220;add to swatches&#8221; button, and it actually adds swatches to the swatches panel. After some decompiling and a lot of detective work, I found an undocumented JSFL call that was added to CS4. The feature is undocumented for a reason: it sends encoded XML data, and if the data is faulty, it crashes Flash. I have a few test cases working and I&#8217;m confident that I can add it to this extension, so the swatches will go right in the Flash swatches panel, rather than onto the stage, though it will only work in CS4. <span style="text-decoration: line-through;">Be on the lookout for an update in the next few days.</span></p>
<p><strong>UPDATE (12/7/08)</strong>: Updated to version 1.1.0. If you have Flash CS4, the swatches will now go right into your Flash Swatches panel. Hooray!<br />
&#8212;</p>
<p>There does seem to be a lot usefulness to such an extension, since XFL creates a new workflow between InDesign and Flash, and the Illustrator importer for Flash is fantastic, but neither one loads any of the swatches from the original document. I&#8217;ve certainly spent my fair share of time opening up the swatch properties, making sure the swatch is RGB or hex and copying all three fields one at a time.</p>
<p>So, I decided to plow ahead and see what I could come up with. The results are below. This extension takes the swatches from your current InDesign or Illustrator document and sends them to a new layer on the Flash stage. You can then use the eyedropper to pick up the colors, or you can add them to your swatches panel individually (similar to <a href="http://www.jnack.com/adobe/flash/kuler_in_flash/" target="_blank">this demo</a> of the Kuler panel).<br />
<strong>UPDATE (12/7/08)</strong>: If you have Flash CS4, you can skip the step above. Version 1.1.0 of this extension will send the Illustrator or InDesign swatches right to your swatches panel in Flash.</p>
<p>This extension will transfer spot and process colors of all varieties (RGB, CMYK, LAB, HSB). Rather than converting the CMYK with my own function, I used the applications themselves to convert the colors to RGB for Flash, so the transfer fidelity is quite good. It will ignore gradients, tints, patterns and fancy stuff like that. If you want to get your gradients into Flash see the bonus tip below.</p>
<h3>InDesign to Flash CS4</h3>
<p><a href="http://ajarproductions.com/adobe_extensions/id/Send-Script-to-Flash_CS4-ID-IMG.jpg"><img class="alignnone" title="Send InDesign Swatches to Flash" src="http://ajarproductions.com/adobe_extensions/id/Send-Script-to-Flash_CS4-ID-IMG.jpg" alt="" width="500" height="300" /></a><br />
Or, here&#8217;s what <a href="http://ajarproductions.com/adobe_extensions/id/Send-Script-to-Flash-ID-IMG.gif">InDesign to Flash CS3</a> would look like.</p>
<h3>Illustrator to Flash CS4</h3>
<p><a href="http://ajarproductions.com/adobe_extensions/ai/Send-Script-to-Flash_CS4-AI-IMG.jpg"><img class="alignnone" title="Send Illustrator Swatches to Flash" src="http://ajarproductions.com/adobe_extensions/ai/Send-Script-to-Flash_CS4-AI-IMG.jpg" alt="" width="500" height="300" /></a><br />
Or, here&#8217;s what <a href="http://ajarproductions.com/adobe_extensions/ai/Send-Script-to-Flash-AI-IMG.jpg">Illustrator to Flash CS3</a> would look like.</p>
<p>Downloads and more below the fold.<span id="more-188"></span></p>
<h2>Downloads</h2>
<ul>
<li><a href="http://ajarproductions.com/adobe_extensions/ai/Send%20Swatches%20to%20Flash.jsx">Send Swatches to Flash.jsx</a> (CS3, CS4)</li>
<li><a href="http://ajarproductions.com/adobe_extensions/id/Send%20Swatches%20to%20Flash%20(ID).mxp">Send Swatches to Flash (ID).mxp</a> (CS4)<a href="http://ajarproductions.com/adobe_extensions/id/Send%20Swatches%20to%20Flash%20(ID).mxp"><br />
</a></li>
<li><a href="http://ajarproductions.com/adobe_extensions/ai/Send%20Swatches%20to%20Flash%20(AI).mxp">Send Swatches to Flash (AI).mxp</a> (CS4-US only)</li>
</ul>
<h2>Installation</h2>
<h3>JSX file:</h3>
<ol>
<li>Place the JSX file into the appropriate directory:</li>
</ol>
<p style="padding-left: 30px;">InDesign CS3/CS4 &gt; {application directory**}<em>/Scripts/Scripts Panel</em><br />
Illustrator CS3 &gt;  {application directory**}<em>/Presets/Scripts<br />
</em>Illustrator CS4 &gt;  {application directory**}<em>/Presets/</em><em>{language/region}/</em><em>Scripts</em></p>
<p style="padding-left: 30px;">**Application Directories:<br />
Windows &gt;<em> C:</em>\<em>Program Files</em>\<em>Adobe</em>\<em>{application name + version}</em>\<br />
Mac OS X &gt; <em>Applications/</em><em>{application name + version}</em><em>/</em></p>
<h3>MXP file (CS4 only):</h3>
<ol>
<li>Double-click on the MXP file to install using Adobe Extension Manager CS4.</li>
</ol>
<h2>Usage</h2>
<p>InDesign: make sure the scripts panel is open, <em>Windows &gt; Automation &gt; Scripts</em>, locate the <em>Send Swatches to Flash.jsx</em> script and double-click to run the script. If you installed the script using the MXP file, the script with be in the <em>Ajar Productions</em> subfolder.</p>
<p>Illustrator: Select <em>Send Swatches to Flash</em> from the <em>File &gt; Scripts</em> menu.<em><br />
</em></p>
<h2>Bonus Tip: Transferring Gradients</h2>
<p>You can get a gradient from Illustrator to Flash by applying the gradient to a rectangle, copying the rectangle and pasting into Flash (CS3 or later). A dialog box will appear in Flash, make sure &#8220;Paste using AI File Importer preferences&#8221; is selected and it will retain you vector artwork, including the gradient! To get the gradient from InDesign to Flash, create the rectangle with the gradient in InDesign, copy and paste it into Illustrator, then copy and paste it into Flash using the instructions in the previous sentence.</p>
<h2>FYI</h2>
<p>I&#8217;ve added a donate button to the bottom of the navigation on the right-hand side of the page. If you&#8217;d like to help us spend more time making stuff that we can share with you, you&#8217;re welcome to leave a tip. Paypal is not required to donate. Donations are not tax deductible.</p>
<p><a href="http://ajarproductions.com/adobe_extensions/ai/Send-Script-to-Flash-AI-IMG.jpg"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/12/05/send-colors-from-indesign-and-illustrator-to-flash/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Merge TextFrames Extension for Adobe InDesign</title>
		<link>http://ajarproductions.com/blog/2008/11/28/merge-textframes-extension-for-adobe-indesign/</link>
		<comments>http://ajarproductions.com/blog/2008/11/28/merge-textframes-extension-for-adobe-indesign/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 03:15:42 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[ExtendScript]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[InDesign]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=160</guid>
		<description><![CDATA[By request—following similar extensions for Flash and Illustrator—here&#8217;s an extension for InDesign that merges multiple textframes into one, while retaining the original styles. Because of properties within InDesign, this extension is actually the most powerful of the three. It accepts characters in the separator field for hard returns, soft returns, and tabs (as well as [...]]]></description>
			<content:encoded><![CDATA[<p>By request—following similar extensions for <a href="http://ajarproductions.com/blog/2008/10/12/flash-extension-combine-textfields/" target="_blank">Flash</a> and <a href="http://ajarproductions.com/blog/2008/11/23/merge-text-extension-for-illustrator/" target="_blank">Illustrator</a>—here&#8217;s an extension for InDesign that merges multiple textframes into one, while retaining the original styles. Because of properties within InDesign, this extension is actually the most powerful of the three. It accepts characters in the separator field for hard returns, soft returns, and tabs (as well as any combination of any other standard characters). There are also options in the dialog box that control the size of the textframe once it&#8217;s been merged (see the variations in the graphic down the page).</p>
<p>I used David Van Brink&#8217;s <a href="http://omino.com/pixelblog/2008/09/21/35/">Omino Dialog Maker</a> code again for the dialog box in this extension.</p>
<p><a href="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_img.gif"><img class="alignnone" title="Merge Textframes Extension for Adobe InDesign" src="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_img.gif" alt="" width="550" height="325" /></a></p>
<p>download and instructions below the fold&#8230;<span id="more-160"></span></p>
<h2>Download</h2>
<ul>
<li><a href="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID.jsx">MergeTextframes_ID.jsx</a> (CS2, CS3, CS4, CS5)</li>
<li><a href="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID.mxp">MergeTextframes_ID.mxp</a> (CS4, CS5)</li>
</ul>
<h2>Installation</h2>
<h3>JSX or JS file:</h3>
<ol>
<li>Place the <em>MergeTextframes_ID.jsx</em> into the Scripts Panel directory within your InDesign application directory:</li>
</ol>
<p style="padding-left: 30px;">Script Panel directory:<br />
CS3/CS4 &gt; {application directory**}<em>/Scripts/Scripts Panel</em><br />
CS/CS2 &gt; {application directory**}<em>/Presets/Scripts/Scripts Panel</em></p>
<p style="padding-left: 30px;">**Application Directories:<br />
Windows &gt;<em> C:</em>\<em>Program Files</em>\<em>Adobe</em>\<em>Adobe InDesign {version}</em>\<br />
Mac OS X &gt; <em>Applications/Adobe </em><em>InDesign</em><em> {version}/</em></p>
<h3>MXP file (CS4 only):</h3>
<ol>
<li>Double-click on the MXP file to install using Adobe Extension Manager CS4.</li>
</ol>
<h2>Usage</h2>
<p>Select the textframes you want to merge in InDesign.</p>
<p>Open the scripts panel, Windows &gt; Automation (or Utilities in CS5) &gt; Scripts.</p>
<p><a href="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_scripts.gif"><img class="alignnone" title="InDesign Scripts Panel" src="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_scripts.gif" alt="" width="252" height="157" /></a></p>
<p>Locate the <em>MergeTextframes_ID.jsx</em> script in the Scripts Panel and double-click to run the script. If you installed the script using the MXP file, the script with be in the <em>Ajar Productions</em> subfolder. If you&#8217;re running InDesign CS3 or CS4 you will be prompted with a dialog box. The dialog box will allow you to select the orientation of the sorting (top, left, bottom, right), use a custom separator character(s), and select options to fit the merged textframe once complete.</p>
<p><a href="http://ajarproductions.com/adobe_extensions/id/mergeTextframe_ID_fitting.gif"><img class="alignnone" title="Frame Fitting Flowchart" src="http://ajarproductions.com/adobe_extensions/id/mergeTextframe_ID_fitting.gif" alt="" width="550" height="410" /></a></p>
<p><strong>Note</strong>: This file has not been tested on CS or CS2, as neither of the two were working on my machine for some reason. In CS/CS2, you will not be prompted with a dialog; the script will run using the default settings sorting topmost, then leftmost, with a separator of “[&gt;&lt;]“ and no fitting options selected. You can then run a Find and Replace and replace the separator with the characters of your choice. This script will likely run in CS(1), but you may have to change the file extension from .jsx to .js.</p>
<p><strong>Update (3/02/2010):<br />
</strong>Version 1.1.0 now has the ability to batch-merge textframes within every page of the current document. I had several requests for something like this (including from a recent donor). Here it is! The download links above have been updated.</p>
<p>The new version now has the &#8220;Apply to&#8221; and &#8220;Ignore locked layers&#8221; as shown in the image below.</p>
<p><a href="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_v110_features.gif"><img class="alignnone" title="Merge Textframes version 1.1.0 new features" src="http://ajarproductions.com/adobe_extensions/id/MergeTextframes_ID_v110_features.gif" alt="Merge Textframes version 1.1.0 new features" width="412" height="224" /></a></p>
<p>Note that any warning messages about having too few textframes selected have been delayed until after the dialog box appears to reflect the new options.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/11/28/merge-textframes-extension-for-adobe-indesign/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>Announcing Merge Text Extension for Adobe Illustrator</title>
		<link>http://ajarproductions.com/blog/2008/11/23/merge-text-extension-for-illustrator/</link>
		<comments>http://ajarproductions.com/blog/2008/11/23/merge-text-extension-for-illustrator/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 23:17:35 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[ExtendScript]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://ajarproductions.com/blog/?p=135</guid>
		<description><![CDATA[Following the release of my Combine Textfields extension for Flash, I&#8217;ve put together a similar extension for Adobe Illustrator. This extension installs a script that will merge text (including text on a path) into one text object, while retaining the style attributes of the individual pieces, including character styles as well as paragraph styles (if [...]]]></description>
			<content:encoded><![CDATA[<p>Following the release of my <a href=" http://ajarproductions.com/blog/2008/10/12/flash-extension-combine-textfields/" target="_blank">Combine Textfields</a> extension for Flash, I&#8217;ve put together a similar extension for Adobe Illustrator. This extension installs a script that will merge text (including text on a path) into one text object, while retaining the style attributes of the individual pieces, including character styles as well as paragraph styles (if the separator includes a return character).</p>
<p><a href="http://ajarproductions.com/adobe_extensions/ai/MergeText_AI_img.png"><img class="alignnone" title="Merge Text Extension for Adobe Illustrator" src="http://ajarproductions.com/adobe_extensions/ai/MergeText_AI_img.png" alt="" width="500" height="350" /></a></p>
<p>Anyone who&#8217;s tried to edit text from a PDF opened in Illustrator knows how frustrating it can be to make simple text edits when the text is broken up. This extension reduces that headache.</p>
<p>Special thanks to <a href="http://omino.com/" target="_blank">David Van Brink</a> for posting the <a href="http://omino.com/pixelblog/2008/09/21/35/" target="_blank">Omino Dialog Maker</a>. His time-saving code was used to produce the dialog box in this extension.</p>
<h2><strong>Download Options</strong></h2>
<ul>
<li><a href="http://www.ajarproductions.com/adobe_extensions/ai/MergeText_AI.jsx">MergeText_AI.jsx</a> (CS2 &#038; up)<a href="http://www.ajarproductions.com/adobe_extensions/ai/MergeText_AI.jsx"><br />
</a></li>
<li><a href="http://www.ajarproductions.com/adobe_extensions/ai/MergeText_AI_CS1.js">MergeText_AI_CS1.js</a> (CS1)<a href="http://www.ajarproductions.com/adobe_extensions/ai/MergeText_AI_CS1.js"><br />
</a></li>
<li><a href="http://www.ajarproductions.com/adobe_extensions/ai/MergeText_AI_en.mxp">MergeText_AI_en.mxp</a> (CS4 &#038; up &#8211; US English)<a href="http://www.ajarproductions.com/adobe_extensions/ai/MergeText_AI_en.mxp"><br />
</a></li>
</ul>
<h2>Installation Instructions</h2>
<h3>JSX or JS file:</h3>
<ol>
<li>Place the <em>MergeText_AI.jsx</em> (or <em>MergeText_AI_CS.js</em>) into the Scripts directory within your Illustrator application directory:</li>
</ol>
<p style="padding-left: 60px;">Windows &gt;<em> C:\Program Files\Adobe\Adobe Illustrator {version}\Presets\en_US\Scripts</em><br />
Mac OS X &gt; <em>Applications/Adobe Illustrator {version}/Presets/Scripts</em></p>
<p style="padding-left: 30px;">Note: In CS4, the directory path will include a region directory (e.g. <em>Adobe Illustrator CS4/Presets/<strong>en_US</strong>/Scripts</em>).</p>
<h3>MXP file (CS4 only):</h3>
<ol>
<li>Double-click on the mxp file to install using Adobe Extension Manager.</li>
</ol>
<h2>Usage</h2>
<p>In Adobe Illustrator, select the text the you want to merge together and go to <em>File &gt; Scripts &gt; MergeText_AI</em>. If you&#8217;re using Illustrator CS3 or CS4, you will be prompted with a dialog box where you can choose your sorting orientation and a custom separator. If you&#8217;re using a version earlier than CS3, you will not be prompted with a dialog; the script will run using the default settings sorting topmost, then leftmost, with a separator of &#8220;[&gt;&lt;]&#8220;. You can then run a Find and Replace and replace the separator with the characters of your choice.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajarproductions.com/blog/2008/11/23/merge-text-extension-for-illustrator/feed/</wfw:commentRss>
		<slash:comments>73</slash:comments>
		</item>
	</channel>
</rss>

