Can someone please give me a script that changes the ruler metric?

Copy link to clipboard
Copied
I just want to run a script that changes whatever the current ruler is to inches, thank you!
Explore related tutorials & articles
Copy link to clipboard
Copied
I actually couldn't find a way to do this with a script, but hopefully someone else will know. But just checking that you know you can right-click on the ruler to change units?

Copy link to clipboard
Copied
thanks, yeah I know I can righ-click but I'd like a script so that I can work it into a series of tasks in an action.
Copy link to clipboard
Copied
You can set the units when you create a new document:
var preset1 = new DocumentPreset;
preset1.units = RulerUnits.Inches;
var doc1 = app.documents.addDocument("Basic CMYK", preset1);
but I don't think you can change them after that.
Copy link to clipboard
Copied
Hello,
Try following snippet
var units = 3; //(0 to 6)
app.preferences.setIntegerPreference("rulerType", units);
/*Unit list
0 : point
1 : pica
2 : inch
3 : mm
4 : cm
5 : H/Q
6 : px */
This will change the ruler units in Units for "General" in Preferences -> Units. So, you can combine this with solution of femkeblanco

Copy link to clipboard
Copied
Thanks, I did see this from an earlier post but I just can't seem to get it to work.

