Skip to main content
Pedro Cortez Marques
Legend
August 24, 2016
Released

P: Ability to "Ruler origin" by script

  • August 24, 2016
  • 19 replies
  • 5790 views

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

19 replies

Pedro Cortez Marques
Legend
August 24, 2016
Well, ps-scrips is inaccessible again, 

I will use Michael Hale ruler orign to get the ruler x,y and I'll have to review all my code to compensate this.

var ref = new ActionReference();  ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );   
var desc = executeActionGet(ref);  
var xOffSet = desc.getInteger(stringIDToTypeID('rulerOriginH'));  
var yOffSet = desc.getInteger(stringIDToTypeID('rulerOriginV'));  
$.writeln( xOffSet >> 16 );
$.writeln( yOffSet >> 16 );

// >> 16 converts the 16bits Integer to pixels (Michael Hale in https://forums.adobe.com/thread/650622)
c.pfaffenbichler
Community Expert
Community Expert
August 24, 2016
In one thread Mike Hale mentioned that he could reset the rulerOrigin but he did not post the code. 
http://www.ps-scripts.com/viewtopic.php?f=66&t=6934&p=34798&hilit=rulerOriginH&sid=8...
Pedro Cortez Marques
Legend
August 24, 2016
It could be done, but still it makes no sense to provoque such a drastic turn arround for my retouchers team.
Participating Frequently
August 24, 2016
You can close and re-open the file to reset the ruler origin the 0,0. 
Pedro Cortez Marques
Legend
August 24, 2016
Sorry Albina, I didn't explain myself write.
I'm not refering a variable name.
I'm refering the x,y position of the origin [0,0] of the rulers.
The user can drag and change de [0,0] position.

What I want is to run a script to allow reset the 0,0 relative position to the document top/left position again.
Pedro Cortez Marques
Legend
August 24, 2016
Hi Albina, are you refering the link Christoph wrote?
That path of PS scripts forum path works perfectly.

Can you explain better?
Inspiring
August 24, 2016
The path you entered, is too long. Enter a shorter pathFile Name could not be found. Check the spelling of the filename, 
and verify that the file location is correct.
Pedro Cortez Marques
Legend
August 24, 2016
I'll ask on ps-scripts, thanks.
c.pfaffenbichler
Community Expert
Community Expert
August 24, 2016