Skip to main content
Inspiring
March 24, 2023
Question

ScriptUI addEventListener broken

  • March 24, 2023
  • 1 reply
  • 287 views

Hi,

I am keeping a few old ScriptUI palettes (which have been converted to CEP) as test environment for debugging the extendscript parts. I just noticed that, in Illustrator 24, it was possible to use

button.addEventListener('click', function(ev) { if(ev.shiftKey) ... });

Now, in Illustrator 27, click does no longer call the function.

Here is a workaround

button.onClick = function() {
  var state = ScriptUI.environment.keyboardState;
  if(state.shiftKey) ...  };
This topic has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
March 24, 2023

thanks for the heads up!