Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

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

$
0
0

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


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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