Move ruler origin to specific co-ords javascript

Contributor ,
Dec 15, 2020 Dec 15, 2020

Copy link to clipboard

Copied

In javascript, this works for global rulers if there is only one artboard:

var doc = activeDocument;
doc.rulerOrigin = [X,Y]

Is there any way to make this work with Artboard Rulers?

I want to be able to click on a point (X,Y) and to run a script which takes those co-ord and puts it into doc.rulerOrigin = [X,Y]

I've used app.activeDocument.rulerOrigin = [0,0]; app.redraw(); to set a blank canvas so to speak, but that didn't help.

Looks like this was asked before https://community.adobe.com/t5/illustrator/move-rulerorigin-to-specific-location/td-p/10374978?page=... but again only works with global rulers with one artboard (and it only works on top left of selected item, not a specific point on that item.)

Thanks.

TOPICS
Scripting

Views

46

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 15, 2020 Dec 15, 2020

Copy link to clipboard

Copied

I should add my js knowledge is minimal!

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines