Skip to main content
Pedro Cortez Marques
Legend
Aug 24, 2016 9:33 AM UTC
Released

P: Ability to "Ruler origin" by script

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
Aug 24, 2016 4:44 PM UTC
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)
Translate
c.pfaffenbichler
Community Expert
Community Expert
Aug 24, 2016 3:54 PM UTC
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...
Translate
Pedro Cortez Marques
Legend
Aug 24, 2016 3:28 PM UTC
It could be done, but still it makes no sense to provoque such a drastic turn arround for my retouchers team.
Translate
Participating Frequently
Aug 24, 2016 3:23 PM UTC
You can close and re-open the file to reset the ruler origin the 0,0. 
Translate
Pedro Cortez Marques
Legend
Aug 24, 2016 2:23 PM UTC
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.
Translate
Pedro Cortez Marques
Legend
Aug 24, 2016 2:16 PM UTC
Hi Albina, are you refering the link Christoph wrote?
That path of PS scripts forum path works perfectly.

Can you explain better?
Translate
Inspiring
Aug 24, 2016 2:09 PM UTC
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.
Translate
Pedro Cortez Marques
Legend
Aug 24, 2016 12:36 PM UTC
I'll ask on ps-scripts, thanks.
Translate
c.pfaffenbichler
Community Expert
Community Expert
Aug 24, 2016 12:26 PM UTC