Move ruler origin to specific co-ords javascript

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

23

Likes

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

Move ruler origin to specific co-ords javascript

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

24

Likes

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
Dec 15, 2020 0
Met0D4D LATEST
Dec 15, 2020

Copy link to clipboard

Copied

I should add my js knowledge is minimal!

Likes

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
Reply
Loading...
Dec 15, 2020 0
Resources