actionscript 3 - photoshop activeDocument -
i writing photoshop plug in in actionscript 3.
i having confusing , frustrating issue app.activedocument. code works photoshop windows on mac "general photoshop errooccurreded. functionality may not available in version of photoshop." error.
to seek , root of issue, wrote class document reference , called test panel. class phone call worked perfectly. included same class in main panel project , breaks.
this class: -
package docrefgetter { import com.adobe.csawlib.photoshop.photoshop; import com.adobe.photoshop.*; public class docrefphotoshop { public static function getdocref():document { var app:application = photoshop.app; var thisdoc:document = app.activedocument; //var thisdoc:document = app.documents.index(0); //tried method homecoming thisdoc; } } } for purpose of posting here, have simplified things little, i.e. have removed things "try, catch" statements code not work in context of panel. tried equivalent phone call jsx code same result, worked windows, worked in test panel on mac, not work in main project on mac.
as said, within test, works perfectly. here test mxml code: -
<?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" historymanagementenabled="false"> <mx:script> <![cdata[ import docrefgetter.docrefphotoshop; import com.adobe.photoshop.document; [bindable] private var hostname:string = hostobject.mainextension; protected function button1_clickhandler(event:mouseevent):void { var thisdocref:document = docrefphotoshop.getdocref(); testlabel.text = string(thisdocref); } ]]> </mx:script> <mx:vbox height="100%" width="100%" verticalalign="middle" horizontalalign="center"> <mx:button label="run ps code" click="button1_clickhandler(event)" /> <mx:label id="testlabel" width="182" text="label"/> </mx:vbox> </mx:application> i can't post main application isn't working in extremely big , complicated asking has come across situation before somehow conflicting type of document reference? have been trying resolve on week now. have tried many different solutions nil has worked. mac photoshop doesn't want see open document.
any suggestions welcome hoping has come across exact situation before , has precise solution.
many taking problem take @ this.
so asking has come across situation before somehow conflicting type of document reference?
it looks code deprecated:
applescript "set docref front end document" command no longer sets focus in photoshop cs5use 1 of workarounds see if works.
actionscript-3 flex flash-builder photoshop flash-javascript-api
No comments:
Post a Comment