3 Replies Latest reply on Sep 21, 2016 2:34 PM by Peter Kahrel

    section marker script

    hamdifem Level 1

      Hello

      I need to change section marker manually all the time with choosing the page.

      I want to change section marker without going to that page.

      I wrote a script for that but script is corrupted and it changes the location of the page.

      My aim is to write page number  on script to change the section marker from that page

      How can I fix this?

       

      var w = new Window("dialog", "Section");
      var panel = w.add('panel', undefined, "----");
      var grup = panel.add('group', undefined, "");
      grup.orientation = "row";
      grup.add('statictext', undefined, "Page");
      var sayfa = grup.add('edittext', [0, 0, 50, 25], "i")
      grup.add('statictext', undefined, "Section");
      sayfa.graphics.font = "Tahoma:16";
      var kisim_isaretcisi = grup.add('edittext', [0, 0, 50, 25], "12")
      kisim_isaretcisi.graphics.font = "Tahoma:16";
      kisim_isaretcisi.active = true;
      w.add('button', undefined, 'Tamam', {name: 'OK'}).onClick = function() {
      w.close(12345);
      }
      if(w.show() == 12345) {
      var doc = app.activeDocument; 
      var curSec = doc.pages.item(i).appliedSection; 
      var name = curSec.name
      var ksm = kisim_isaretcisi.text;
      var syf = Number(sayfa.text);
      if(!syf){
      syf = i;
      }
      doc.sections.add({pageStart: doc.pages.item(syf), marker: ksm, name: name })
      }