• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is there a way to embed a javascript alert in Illustrator to run on open?

Enthusiast ,
Mar 29, 2017 Mar 29, 2017

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.

TOPICS
Scripting

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
People's Champ ,
Mar 30, 2017 Mar 30, 2017

Copy link to clipboard

Copied

I don't think you can embed javascript code inside a document so it executes itself on opening.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 30, 2017 Mar 30, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2017 Mar 30, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 30, 2017 Mar 30, 2017

Copy link to clipboard

Copied

That's just for Illustrator itself, right?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2017 Mar 30, 2017

Copy link to clipboard

Copied

yes, Silly V. you are correct. i misread the post. =(

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 02, 2017 Apr 02, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 02, 2017 Apr 02, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 03, 2017 Apr 03, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 03, 2017 Apr 03, 2017

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

LATEST

Thanks! I can't imagine SDK will let me do what I want to do either, but I'll give it a shot!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines