Reseting "Ruler origin" is impossible by script?

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: Tom, Kukurykus

User avatar
pedro.marques
Posts: 8
Joined: Fri Aug 19, 2016 2:24 pm
Location: Portugal

Reseting "Ruler origin" is impossible by script?

Post by pedro.marques »

Hi,
I want to make sure a user has its ruler origin reseted to document top/left.
But I can't reset it by script.

Is there something I'm missing?
User avatar
pedro.marques
Posts: 8
Joined: Fri Aug 19, 2016 2:24 pm
Location: Portugal

Re: Reseting "Ruler origin" is impossible by script?

Post by pedro.marques »

Here is the answer from Michael Hale

Re: how to change ruler's Origin
Postby Mike Hale » Mon Oct 25, 2010 8:56 pm
A couple of thoughts. Scriptlistener doesn't record changing the ruler offset because that is done with the mouse and scriptlistener doesn't record most actions done with the mouse. And I don't see any other way to change it in the GUI using menus or keyboard shortcuts.

RulerOriginH and RulerOriginV are two of a document's action descriptor keys. You can use those IDs to get the current offsets. There are some things that you can get but not set and this may be one of those. When I try to construct an executeAction to set the offset the best I can do is set it to 0. That is to say no matter what value I use in the executeAction, the ruler resets to 0.

I have never spent a lot of time trying to get setting the offset to work so it may be possible but I suspect that it needs access to the ruler class and action manager does not have that access.