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

Run java script from plug-in

New Here ,
Aug 30, 2015 Aug 30, 2015

Hi,

Is there any way to run a javascript file from a plug-in? I'm thinking of attachjavascript filewith plug-in bundle in Mac resource and wondering if I can run that script from my plugin? Thank you!

TOPICS
SDK
833
Translate
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
Enthusiast ,
Aug 31, 2015 Aug 31, 2015

Why do you need to run a javascript file from a plugin?

Is there anyway to do that using illustrator sdks? (no apis available for yours needs?).

Or shouldn't you develop an extension instead?

Thomas.

Translate
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 ,
Aug 31, 2015 Aug 31, 2015

I think I looked into this for a customer about a year ago and concluded that there was no way to execute a script from code in Illustrator. You can of course run a script manually as a user by going to File > Script (or whatever it is) and picking one, but there isn't an API to do it from a plugin.

Translate
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 ,
Aug 31, 2015 Aug 31, 2015

Since no APIs are available (Illustrator SDK) to complete this task, this should be delegated to an extension. 

Translate
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
New Here ,
Aug 31, 2015 Aug 31, 2015

Thank you very much for your replies. The reason I want to run script from inside plugin is that I want to reuse the functionalities I've done in the script. Rewriting it in plugin is quite time consuming. It's too bad that we don't have any API for this. Could you please explain more about an extension? Is there any other way to reuse javascript in plugin?

Translate
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 ,
Sep 01, 2015 Sep 01, 2015
LATEST

Take a look at this link (CS5-CS6):

http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/creativesuite/pdfs/CS_SDK_Guide.pdf

You should find everything you need.

You can use extensions if you want to extend Illustrator functionalities.

you can do that with c++ plugin as well.  

Translate
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