Thread View: adobe.scripting.indesign
2 messages
2 total messages
Started by Seth_McGraw
Fri, 20 Feb 2009 17:12
Drop down menu help
Author: Seth_McGraw
Date: Fri, 20 Feb 2009 17:12
Date: Fri, 20 Feb 2009 17:12
5 lines
908 bytes
908 bytes
There are 18 colors and a selection for "none" that I want in a drop down menu. The menu is made already, but I have no clue how to set it up. Can anyone show me a simple drop down menu in an example? The value (0-19) returned is going to hopefully associate with an array with the 18 color names (although I'm not sure how to do that either). Thanks
Re: Drop down menu help
Author: Kasyan_Servetsky
Date: Fri, 20 Feb 2009 18:02
Date: Fri, 20 Feb 2009 18:02
34 lines
1538 bytes
1538 bytes
myDialogResult();
if (myReturn) {
alert("You selected " + app.activeDocument.swatches[myDropdownResult].name);
}
else {
alert("You canceled dialog.");
}
function myDialogResult(){
with(myDialog = app.dialogs.add({name:"Swatches in the active document"})){
myDialogColumn = dialogColumns.add();
with(myDialogColumn){
with(borderPanels.add()){
staticTexts.add({staticLabel:"Swatches "});
myArray = app.activeDocument.swatches;
myDropdown = dropdowns.add();
myDropdown.stringList = myArray.everyItem().name;
myDropdown.selectedIndex = 0;
}
}
myReturn = myDialog.show();
if (myReturn == true){
myDropdownResult = myDropdown.selectedIndex;
myDialog.destroy;
return myDropdownResult;
}
else {
myDialog.destroy();
}
}
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads