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

GetSelectedArt not working when called from an extension event

New Here ,
Nov 03, 2016 Nov 03, 2016

Copy link to clipboard

Copied

Hello everyone,

I have the following problem:

I need to do some things to the currently selected art objects when the user clicks a button in my HTML extension.

For that I pass an event from the extension to the C++ plugin. This event is properly caught and calls a function which does the following:

AIErr result(kNoErr);
AIArtHandle ** selectedArt = nil;
ai::int32 selectedCount(0);

result = sAIMatchingArt->GetSelectedArt(&selectedArt, &selectedCount);

This function always fails - the selectedCount is always zero and result is an error code "?COD" which I cannot find anywhere in the documentation.

However, when calling this function directly from the C++ plugin (like through a menu item) it works properly and yields the current selection.

I am using Illustrator CC 2015.3 on Windows.

Any ideas?

TOPICS
SDK

Views

400

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

correct answers 1 Correct answer

Engaged , Nov 03, 2016 Nov 03, 2016

Sounds like you need to push the AppContext to make suite calls work. '?COD' is actually 'DOC?' which would be the case if you don't have a context.

I do this in my extension controller functions before calling suite functions, as per the sample code:

AppContext appContext(gPlugin->GetPluginRef());

Votes

Translate

Translate
Adobe
Engaged ,
Nov 03, 2016 Nov 03, 2016

Copy link to clipboard

Copied

Sounds like you need to push the AppContext to make suite calls work. '?COD' is actually 'DOC?' which would be the case if you don't have a context.

I do this in my extension controller functions before calling suite functions, as per the sample code:

AppContext appContext(gPlugin->GetPluginRef());

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
New Here ,
Nov 03, 2016 Nov 03, 2016

Copy link to clipboard

Copied

LATEST

That did indeed solve my problem, thank you very much!

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