Copy link to clipboard
Copied
Hi! I have a few script-related questions for InDesign and someone recommended these forums.
There's a couple things I'd like to do, one is to create a panel with buttons and such, and another is to draw guides. I'm learning some basic scripting for drawing a dialog window in InDesign, creating text and buttons and groups and so on.
But, one thing that would be nice is to align things in various ways, and space them out. For any given panel with various horizontal and vertical child elements, is there a way to align things left, center and right? And then also, how do you distinguish between left-right alignment and up-down alignment?
For drawing a guide, the following script seems to hold
app.documents[0].pages[0].guides.add ({
location: 12,
orientation: HorizontalOrVertical.VERTICAL
});
However, I don't want this to be "document 0" and "page 0", I want it to draw a guide on whichever page I coincidentally happen to have selected.
Is there a way to instead draw guides on whatever page and document is actively selected?
Copy link to clipboard
Copied
Hello @dane13860245,
Give this a try...
app.activeWindow.activePage.guides.add({location: 12, orientation: HorizontalOrVertical.VERTICAL});Regards,
Mike
Find more inspiration, events, and resources on the new Adobe Community
Explore Now