1 Reply Latest reply on May 15, 2015 8:14 AM by pawelk55927705

    How can I use app.activeDocument from function launched by "window" or "palette" button of JavaScript GUI?

    pawelk55927705

      Hi!

      I am trying to create a script that automatizes creating dimensions. What I've done so far is:

      If a shape is selected then, after runing a script "dialog" window appears with options and "create" button.

      The problem is that the script has got to be launched every time, for every line that need dimension. I'd like to have this window allways open and use it when I need to add dimension to some line.

      But with a dialog type of window this cannot be done because when window opens it ios impossible to use any other tool or menu item. With "window" or "palette" window type it is possible to use them but it is impossible to use app.activeDocument, commands from it, like app.activeDocument.layers.add or app.activeDocument.selection just do not work and I need them.

       

      So how should I do this?

       

      If this is not possible, then maybe there's a way to add some button to the menu that launches my script instead, it would not be a perfect way to use it, but would work beather than the current way anyway.?

       

      Regards