Skip to main content
Inspiring
March 13, 2026
Question

Toggle selection script

  • March 13, 2026
  • 1 reply
  • 23 views

I‘ll have another stab at this as I don’t understand this script behaviour:

Basically two commands

 

var id123 = charIDToTypeID( "Invs" );
executeAction( id123, undefined, DialogModes.NO );

 Inverse selection (not inverse pixel colour) - works fine

 

show/hide the crawling ants selection by toggling it:
 

app.runMenuItem(stringIDToTypeID("toggleEdges"));

toggles the visibility of the current selection on/off

 

Yay! Two tiny bits of code work just fine.

 

However... they don’t run one after another, you can’t inverse the selection and then hide the selection. I’ve tried. I have no idea why. I’ve added a delay, separate scripts, separate actions, toggle the selection twice. No dice.

 

I’m stumped as to why the two bits of code won’t work sequentially. Any ideas? 
Answers on a postcard

    1 reply

    Stephen Marsh
    Community Expert
    Community Expert
    March 13, 2026

    Great question! Wish I had an answer… :]