Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87055

Re: Can you correct my unfunction my script?

$
0
0

Hi, Jarek

 

I change it into this format (for in case of find-change two or more items)but not work: ---- why?

 

var 

  mySelected = Number( app.extractLabel("mDialog") ),     //     previous selection's set 

  myDialog = app.dialogs.add({name:"add continueds",canCancel:true}); 

  if ( isNaN( mySelected ) ) mySelected = 0; 

 

  with(myDialog){ 

       with(dialogColumns.add()){ 

            with(dialogRows.add()){ 

                 var 

                 mySelection = dropdowns.add({stringList:["01   Continued", "02   continued", "03   Cont'd","04   cont'd","續"], selectedIndex: mySelected}); 

            } 

       } 

  } 

 

 

if (myDialog.show() == true) 

    main(); 

myDialog.destroy(); 

 

 

function main(){ 

  mySelected = app.insertLabel( "mDialog", String(mySelection.selectedIndex) );     //     to remember selection's set 

  if(app.selection.length && app.selection[0].hasOwnProperty ("contents") ) addContinueds();  

  else alert("Wrong selection. Please try again."); 

function addContinueds() {  

  app.findGrepPreferences = app.changeGrepPreferences = null; 

  switch (mySelection.selectedIndex){ 

       case 1:

  app.findGrepPreferences.findWhat = "(.)\\r"; 

  app.selection[0].changeGrep(); 

  app.changeGrepPreferences.changeTo = "$1 (continued)\\r"; 

  app.findGrepPreferences = app.changeGrepPreferences = null; 

            break; 

       case 2:

  app.findGrepPreferences.findWhat = "(.)\\r"; 

  app.selection[0].changeGrep(); 

  app.changeGrepPreferences.changeTo = "$1 (Cont'd)\\r"; 

  app.findGrepPreferences = app.changeGrepPreferences = null; 

            break; 

       case 3:

  app.findGrepPreferences.findWhat = "(.)\\r"; 

  app.selection[0].changeGrep(); 

  app.changeGrepPreferences.changeTo = "$1 (cont'd)\\r"; 

  app.findGrepPreferences = app.changeGrepPreferences = null; 

            break; 

       case 4:

  app.findGrepPreferences.findWhat = "(.)\\r"; 

  app.selection[0].changeGrep(); 

  app.changeGrepPreferences.changeTo = "$1(續)\\r"; 

  app.findGrepPreferences = app.changeGrepPreferences = null; 

            break; 

       default:

  app.findGrepPreferences.findWhat = "(.)\\r"; 

  app.selection[0].changeGrep(); 

  app.changeGrepPreferences.changeTo = "$1 (Continued)\\r"; 

  app.findGrepPreferences = app.changeGrepPreferences = null; 

            break; 

       } 

}


Viewing all articles
Browse latest Browse all 87055

Trending Articles