Copy link to clipboard
Copied
As the question states, I'm just wondering if it's possible to embed a javascript alert in an individual Illustrator file. I could see why it would not be based on security but I'm just trying to trigger an alert on open, similar to alerts you're able to create on the web.
Copy link to clipboard
Copied
I don't think you can embed javascript code inside a document so it executes itself on opening.
Copy link to clipboard
Copied
Only if you have a script that you use to open any document instead of native open command, which can also read specially-hidden messages embedded somewhere in the file. Or, maybe the CEP extensions have this event as part of available events.
Copy link to clipboard
Copied
You can create a script/snippet and put it in the "Startup Scripts" folder and it will execute on open.
on a mac it's located here: /Applications/Adobe Illustrator CC[version]/Startup Scripts
The folder doesn't exist by default, so if you don't have one already you'll need to create one.
Copy link to clipboard
Copied
That's just for Illustrator itself, right?
Copy link to clipboard
Copied
yes, Silly V. you are correct. i misread the post. =(
Copy link to clipboard
Copied
may be a bit hack.
you could write a small program with AHK or something.
then direct all AI files to open using your program.
your program could have the alert, and then open your file in illustrator.
you could have a test in there as to if the alert is shown or not.
ie.
add a meta tag "Keyword" = warning
your program can read file as text, find "<rdf:li>warning</rdf:li>" and send alert if found.
Copy link to clipboard
Copied
or you could just get your exe to open the file in illustrator, and then run a jsx file to do your test and alert from within the illustrator dom
Copy link to clipboard
Copied
Thanks for the feedback! Unfortunately I need it to work on user computers without any additional install. These are great suggestions, but unfortunately not scalable to end users.
Copy link to clipboard
Copied
looks like your best bet would be to dive in to the SDK.
you need a custom callback.
good luck with it, I'd love to hear back if you find a solution...
Copy link to clipboard
Copied
Thanks! I can't imagine SDK will let me do what I want to do either, but I'll give it a shot!