Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Dropdown list remember last selected

$
0
0

I have a dropdownlist dialog, and I want to remember last selected, and next time when I run the script the selectedIndex will be the last selected index, for example, when I select number 3, it will type 3 in the insertionPoints, and next time I run the script again, I want the Selected:3

 

 

myDisplayDialog();

function myDisplayDialog(){

var myDialog = app.dialogs.add({name:"Symbol_v1.0"});

  with(myDialog.dialogColumns.add()){

  with(dialogRows.add()){

  with(dialogColumns.add()){

  staticTexts.add({staticLabel:"Selected: "});

                var mySymbolArray = ["1","2","3","4","5"];

                var myEachSymbol = mySymbolArray.toString().split(",");

              with(dialogColumns.add()){

                   var myDropdownsTran = dropdowns.add({stringList:mySymbolArray, selectedIndex:0});

                    //myDropdownsTran = dropdowns.add({stringList:mySymbolArray, selectedIndex:0});

                    

               }

            }

        }

    }

 

 

 

 

var myResult = myDialog.show();

  if(myResult == true){

 

 

        app.selection[0].texts[0].contents  = myEachSymbol[myDropdownsTran.selectedIndex];

}

}


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>