2 Replies Latest reply on Nov 3, 2016 6:13 AM by Dieter (Paul)

    GetSelectedArt not working when called from an extension event

    Dieter (Paul) Level 1

      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?