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

Illustrator pathItem.onEdit

Explorer ,
May 03, 2016 May 03, 2016

Copy link to clipboard

Copied

I'm developing an extension with HTML5 Panels. I'd like to add an event listener or callback function so that a script is triggered to run when a path is being edited. I can't seem to find any documentation on this. Does anyone have ideas for how to do this?  Working in JS/Extend Script

TOPICS
SDK

Views

713

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
LEGEND ,
May 03, 2016 May 03, 2016

Copy link to clipboard

Copied

As far as I know there is no such thing. Unless actually used/ triggered, scripts don't track any activity and there is no global evaluation loop or messaging system that could fire scripts merely based on editing an object.

Mylenium

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
May 04, 2016 May 04, 2016

Copy link to clipboard

Copied

Moving to Illustrator SDK​.

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 ,
May 05, 2016 May 05, 2016

Copy link to clipboard

Copied

the only way I can think of doing this would be very hack and prob cause some major issues.

setInterval(function(){ isSelected(); },500);

if the above is in your main JS file we now have a timer that triggers the function isSelected every half a second.

now you can use that function to ask illustrator if an item is being worked on and use a callback to get the result back to your HTML panel

lowering the time would make it more responsive but chew lots of resources

upping the time makes the script slow to respond but improves overhead.

I should note that I have not tried this.

no reason it should not work.

but I don't think it is viable for a real world solution.

but I may be wrong on that too.

maybe if I find some time in the next week or so I will give it a test.

if I do I will post my results.

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 ,
May 09, 2016 May 09, 2016

Copy link to clipboard

Copied

Such a thing could be done using C++ plugin.

You have to use notifiers to be notify when a item is updated or modified.

I have never done that in script.

Using timer is never a great idea!

Thomas.

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 ,
May 10, 2016 May 10, 2016

Copy link to clipboard

Copied

using a short timer in a never ending loop is not a great idea.

never using a timer is a big call as there are many perfectly valid and acceptable uses of a timer.

if you have never coded in a language like C++, and have never used visual studio, etc. etc. then a traditional plugin is a big task to write. the new HTML panels are a small step if your comfortable with javascript and the illustrator dom.

lets take and example of what I thought the OP may be trying to accomplish:

script does a bunch of stuff,

now it want user to do something.

here it does the polling using the timer.

when done the script continues.

in a case like this you might be able to get away with a timed loop as it is only running for a short time.

if the OP intends to make a new custom tool or something that is going to spend all day listening for user interaction, then I would be confident of it crashing, and chewing resources, and I would not recommend it.

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 ,
May 11, 2016 May 11, 2016

Copy link to clipboard

Copied

I do agree. There are many acceptable uses for using timers.

But, often, there are better solutions available.

In his case, I'm not 100% sure that doing that using script is the best solution. (fast, efficient, robust, ....).

You can definitely do it, but I won't. I'd rather do that using C++ plugins (SDK).

This thread was added to Illustrator SDK forum, so I guess Erickk knows C++ erickk56243057

regards,

Thomas.

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 ,
May 15, 2016 May 15, 2016

Copy link to clipboard

Copied

is there a dedicated forum for HTML panels?

If so I must know...

as the SDK includes HTML panel examples, I assumed that the SDK forum would be the place to talk about them.

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 ,
May 17, 2016 May 17, 2016

Copy link to clipboard

Copied

LATEST

I do try to get answers from here:

Creative Suite Extension Builder

or here:

Creative Suite SDK

But no very efficient!

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