how to change ruler's Origin

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

catpishy

how to change ruler's Origin

Post by catpishy »

I am trying to make the center of the docunemt (image) the origin (0,0) intially the origin is at upper left corner of the image; this can be done manually as you know by draging the upper left corner of ruler to the desired location as the origin of image. I tryied "ScriptListener" to record this but it does not recorder the process; Is this means that I can not change the origin through scripting?

I looked through "PS Constant Ref" and find commands like "RulerOriginH" and "RulerOriginV" why they don't show when using 'ScriptListener"?

Thanks for you help in advance

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

how to change ruler's Origin

Post by Mike Hale »

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.
My old boots

how to change ruler's Origin

Post by My old boots »

Why would you want to do this? Are you exiting the script and needing the origin in the centre for some manual work to be carried out?

I can think of any reason a script would need the origin in the centre.
Mike Hale

how to change ruler's Origin

Post by Mike Hale »

I would think that he wants to script setting the ruler offset for similar reasons one would want to change the offset in the GUI.

People often ask how to do things that really don't help the script function any better like closing a layerset.