Quantcast
Channel: Adobe Community : Discussion List - Illustrator Scripting
Viewing all articles
Browse latest Browse all 3671

Make new document with an Illustrator Extension

$
0
0

Hi

 

When I try to create a new document from an HTML extension by calling a jsx script the script freezes until Illustrator is put into focus (for example by clicking it)

Only after focus returns to Illustrator will the script continue, in the meantime the Illustrator icon will jump around like a nutter.

 

I have not tired this out on windows only mac.

 

To get around this I get main.js to exec 3 oascript comands

 

1) to create the document: oascript -e 'tell application "Adobe Illustrator" to make new document'

2) focus on Illustrator: oascript -e 'activate application "Adobe Illustrator"'

3) run the jsx: oascript 'do javascript  "path/to/my/script.jsx"'

 

This works but there are some obvious drawbacks.

Has anyone managed to create via an extension a new document and have the script work on it without the need for focusing on Illustrator without the use of oascript?

If so how?

 

Interestingly enough, if one runs from the applescript editor

tell application "Adobe Illustrator" to make new document

it will work fine. but if one runs from terminal

oascript -e 'tell application "Adobe Illustrator" to make new document'

it freezes Illustrator and causes the Icon to jump like a nutter until refocus.

 

Regards

 

Trevor


Viewing all articles
Browse latest Browse all 3671

Trending Articles



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