Skip to main content
Participant
February 9, 2021
Answered

How to check if the Rullers in Photoshop are On / Off via script?

  • February 9, 2021
  • 2 replies
  • 416 views

When I want to turn the rullers on or off, I need to know is it on or off right now? Because if it is off, then the code will turn it on, and vice versa.

 

How to check if the Rullers in Photoshop are On / Off via script?

 

Note: I used below url to turn it on and off. Thanks to Adobe team.

https://community.adobe.com/t5/photoshop/hide-disappear-the-rulers-in-photoshop-via-script/m-p/11817328#M511094

 

This topic has been closed for replies.
Correct answer jazz-y

 

#target photoshop
s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('rulersVisibility'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
alert(rulersVisibility = executeActionGet(r).getBoolean(p));

 

 

2 replies

Kukurykus
Legend
February 9, 2021

Why you create topic for question the answer for you got in the linked thread during your previous visit?

jazz-yCorrect answer
Legend
February 9, 2021

 

#target photoshop
s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('rulersVisibility'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
alert(rulersVisibility = executeActionGet(r).getBoolean(p));