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

Calling functions from UI palette

$
0
0

Hello,

From what I understand, you can't call complex functions from a scripted UI palette, only from "dialog" windows (which are usless in my case) because I need the persistance of a palette.

 

I have a series of scripts in use now that are  accessed from the usual "file-scripts folder" within Illustrator itself (about 27 of them).  I want to script a palette window so users can acces them without the usual mouse clicks down the menu system.

 

I'm able to call a simple "Hello World" type function using the "onClick()" method from a button of a scripted palette window, but I cannot use my regular working scripts inside a function that's called from the button.  In X-Code, I was able to write my scripts individually, then just add them to a main floating window via a separate function when they were completed.  But, I'm finding Javascript a little more tricky.

 

If I copy my other's script code into the function in the palette window script, it runs, but it runs before I click the button! --  After in runs, then the palette window is displayed(?).  If I try to use the execute() method with "onClick", the script just opens in the SDK, it will not and does run in Illustrator.

 

I take both of these as clear indications that I have no clue what I'm doing (or that I'm trying to do the impossible).

 

I did find someone with a similar problem, but they were scripting After Effects and were offered this solution:

 

system.callSystem ('afterfx -r "/C/Program Files/Adobe/Adobe After Effects CS3/Support Files/Scripts/GlobalVars.jsx"');

 

 

Is there anything I can do in Illustrator that will allow me to call (or execute) my other scripts/functions and have them execute within Illustrator?

 

Thanks for any and all help!


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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