Copy link to clipboard
Copied
Hello,
I want to start Illustrator and load a file on Windows environment by executing a Java-Script with the windows Scripting Host. The content of the Java-Script file is like:
var illustrator = new ActiveXObject("Illustrator.Application");
illustrator.open("c:\\temp\\1.pdf");
Illustrator starts, I see the Splash-Screen but after that no window of Illustrator appears while Illustrator is shown running in the task manager.
Similar calls to InDesign and Photoshop work well. The programs are started and shown on the screen.
Is there a possibility to get it running, without a Shell-Exec?
Thank you in advance
Copy link to clipboard
Copied
try
activedocument.activate
Copy link to clipboard
Copied
Thanks, but that doesn't help.
I already tried:
illustrator.activate;
illustrator.show;
which has also no effects.
Copy link to clipboard
Copied
As far as I know (on the mac side) you can't get the app to the front if calling from outside. All I get if I try from ESTK or Bridge is a bouncy dock icon once I have clicked it then the script continues… I have to cheat and have AppleScript Activate the app first…
#target illustrator var a = app.documents.add(DocumentColorSpace.RGB) a.activate();
Even this does NOT come to the front most process for me… I think running scripts from inside the app is expected. There maybe some bridgetalk way around this but I don't recall it…
Copy link to clipboard
Copied
Thank you for the answer, but it doesn't work.
Everything is fine, if I start Illustrator first by hand and launch my script, but if I start the script first (which launches Illustrator itself) the program is not visible.
I wonder about, because Photoshop and InDesign react different. If I launch these programs by scripting, they are per default visible.
On the MAC I do similar things with AppleScript. My Script launches Illustrator, and it is visible immediately.
Any ideas?
Copy link to clipboard
Copied
Indesign has the method activate(); Photoshop has the method bringToFront(); Illustrator has none at app level it only has this at document level which as you have noticed does NOT work… I know of NO direct way to do this using ExtendScript… Sorry…
Copy link to clipboard
Copied
try WScript.CreateObject instead of new ActiveXObject, I tested it with an old computer (in this machine I keep getting "JScript Error Expected ";") that has no illustrator. I was able to open and show photoshop and office programs.
var illustrator;
illustrator = WScript.CreateObject("Illustrator.Application");
illustrator.open("c:\\temp\\1.pdf");
Carlos Canto
Copy link to clipboard
Copied
Really nice, I did it already by this way. It'll work for other programs but not for Illustrator.
No idea why.
Thanks
Norbert