Check if grid, guides are visible

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Kukurykus, Tom, xbytor

Posts: 4
Joined: Tue Nov 17, 2020 11:10 pm

Check if grid, guides are visible

Post by timobee »

How would I check are grids/guides visible? I would also need to know if guides are locked or not. I need to relay this information back to my CEP panel UI state.

It's enough that it would be compatible with cc18 and newer.

This code always returns true even if guides are hidden (cc21)

Code: Select all

  var r = new ActionReference();
  r.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "guidesVisibility" ) );
  r.putEnumerated( charIDToTypeID( "Dcmn" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
  var guides_is_visible = executeActionGet(r).getBoolean(stringIDToTypeID("guidesVisibility"));             

User avatar
Posts: 317
Joined: Mon Jul 25, 2016 12:36 pm

Re: Check if grid, guides are visible

Post by Kukurykus »

When you (un)tick Guides, the next item Guide Canvas gets effect, while first is always checked. Look for some workaround: Test if guides visible?