PDA

View Full Version : JSFL wrapped with MMExecute


Cineza
02-09-2008, 01:04 PM
Could someone please tell me, how you would wrap the following JSFL with MMExecute (to use on a custom panel):

var itemIndex = fl.getDocumentDOM().library.findItemIndex("LText");
var theItem = fl.getDocumentDOM().library.items[itemIndex];
fl.getDocumentDOM().addItem( {x:0,y:0} , theItem);
var cur_doc = fl.getDocumentDOM();
for(var i1=0; i1<cur_doc.selection.length; i1++){
if(cur_doc.selection[i1].elementType == "instance"){
cur_doc.selection[i1].name = cur_doc.selection[i1].libraryItem.name
}
}

lobo
06-02-2008, 06:01 PM
save your code in jsfl file and then execute this file:
MMExecute ('fl.runScript("'+file_path+'");");