hello,
i'm working on creative suite extension, show collection of images on panel (indesign, photoshop , illustrator).
i need application's path in few javascript files , i'm getting weird problems on our testing-mac. have reduced code few lines possible, show problem.
currently i'm using photoshop cs5.1, flash builder 4.6 , extension builder 1.5 on windows machine.
this code:
<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="initializehandler()">
<mx:script>
<![cdata[
import com.adobe.csawlib.photoshop.photoshop;
import com.adobe.photoshop.*;
protected function initializehandler():void
{
var app : com.adobe.photoshop.application = com.adobe.csawlib.photoshop.photoshop.app;
if(app.path)
mylabel.text = app.path.nativepath;
else
mylabel.text = "app.path null";
}
]]>
</mx:script>
<mx:vbox height="100%" width="100%" verticalalign="middle" horizontalalign="center">
<mx:label id="mylabel"/>
</mx:vbox>
</mx:application>
on windows machine mylabel shows installation directory's path. on our mac app.path null, not work.
i have tried many different approaches solve this, doesn't work yet. here ideas of tried far:
- path in javascript instead using app.path.fsname (app.path null on mac in javascript too, @ least when it's called initialzehandler)
- put timer in initializehandler, wait 10 seconds , try path (not idea , app.path still null)
- put button on panel executes initializehandler instead. (app.path working, need work without user interaction).
can enlighten me please?
btw. i'm developer trainee there simple solution or obvious mistake, feel free point them out.
hi,
for worth, extension builder 2.0 (flash builder 4.5.1) on osx lion, following works:
package
{
import com.adobe.csawlib.photoshop.photoshop;
import com.adobe.photoshop.*;
public class zphotoshop
{
public static function run():void
{
var app:application = photoshop.app;
if(app.path) {
trace("app path is: " + app.path.nativepath);
} else {
trace("null path");
}
}
}
}
(this in .as file eb creates default)
the result is:
app path is: /applications/adobe photoshop cs6
regards,
davide
More discussions in Creative Suite Extension Builder
adobe
Comments
Post a Comment