Adobe 65009333 Scripting Guide - Page 61
For example, The following functions read the XML file and set up the button bar
UPC - 883919155852
View all Adobe 65009333 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 61 highlights
User Interfaces Working with ScriptUI 61 For example: text FindChangeByList /c/buttons/FindChangeByList.jsx text SortParagraphs /c/buttons/SortParagraphs.jsx The following functions read the XML file and set up the button bar: #targetengine "session" var myButtonBar; main(); function main(){ myButtonBar = myCreateButtonBar(); myButtonBar.show(); } function myCreateButtonBar(){ var myButtonName, myButtonFileName, myButtonType, myButtonIconFile, myButton; var myButtons = myReadXMLPreferences(); if(myButtons != ""){ myButtonBar = new Window('window', 'Script Buttons', undefined, {maximizeButton:false, minimizeButton:false}); with(myButtonBar){ spacing = 0; margins = [0,0,0,0]; with(add('group')){ spacing = 2; orientation = 'row'; for(var myCounter = 0; myCounter < myButtons.length(); myCounter++){ myButtonName = myButtons[myCounter].xpath("buttonName"); myButtonType = myButtons[myCounter].xpath("buttonType"); myButtonFileName = myButtons[myCounter].xpath("buttonFileName"); myButtonIconFile = myButtons[myCounter].xpath("buttonIconFile"); if(myButtonType == "text"){ myButton = add('button', undefined, myButtonName); } else{ myButton = add('iconbutton', undefined, File(myButtonIconFile)); } myButton.scriptFile = myButtonFileName; myButton.onClick = function(){ myButtonFile = File(this.scriptFile) app.doScript(myButtonFile); } } } } }