Script to get and set the document's layoutWindow's view bounds

Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Hi all, I'm looking for a way to set the document's layoutWindow view bounds so that I can precisely alter what the user of a document is looking at. The closest post here I could find was this answer by @Laubender, but it doesn't quite do what I need. Example use case: matching a document's view to another document.

Any help would be much appreciated!

- Mark

TOPICS
Scripting

Views

85

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 01, 2022 Jul 01, 2022

For now, there seems to be no solution. I have created this feature request. Feel free to upvote.

- Mark

Likes

Translate

Translate
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Hi Mark,

tell us more about what you like to do. Some screenshots will help.

Also search for code by Gerald Singlemann on the web. He once did a script that is synchronizing two layout windows so that in effect, that if you go to the next spread of one document, the view of the other document in the other layout window will follow.

 

A good start of your search could be the InDesign or InDesign Scripting forum at hilfdirselbst.ch.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

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
community guidelines
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Thanks Uwe, I'll go on a search.

 

My use is to be able to match document B's view to document A's view (so when I switch between the two document's windows they are identically positioned in relation to the document. Your script I linked to does this, but it essentially sets the position. I want to read the position, then set another document's view to that position.

- Mark

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
community guidelines
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Hi Mark, does this work?

 

//the active window
var w1 = app.layoutWindows[0];
//window behind the active window
var w2 = app.layoutWindows[1];

w1.bounds = w2.bounds

 

The bounds array property for a window might not be what you expect—its the [bottom, left, top, right] distances from the screen’s bottom, left, top, right sides.

 

I posted this the other day for setting the layout window position as a percentage of the available screen space:

https://community.adobe.com/t5/indesign-discussions/second-opened-document-window-opens-larger-than-...

 

 

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
community guidelines
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Thanks Rob, great thought, but unfortunately not. I need to read the view's bounds not the window's bounds. 

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
community guidelines
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Hi Mark,

found some code from Gerald Singelmann, but I do not think that it will help you very much.

Four scripts in total that can be run by four different keyboard shortcuts to get the next, the previous, the first and the last active spread of all documents in all open layout windows.

 

Also see into my post here, still not exactly what you want, but read into my published code:

Horizontal artboards or grouped in Indesign?
Laubender, Jan 08, 2020
https://community.adobe.com/t5/indesign-discussions/horizontal-artboards-or-grouped-in-indesign/m-p/...

 

Regards,
Uwe Laubender
( Adobe Community Professional )

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
community guidelines
Adobe Community Professional ,
Jun 30, 2022 Jun 30, 2022

Copy link to clipboard

Copied

Here a link to an article by Gerald Singelmann through web archive:

 

Dokumente vergleichen (visuell)
by Gerald Singelmann | 17 Januar, 2009 - 19:34

http://web.archive.org/web/20140625102144/http://indesign-faq.de/de/dokumente-vergleichen-visuell

 

The link to that set of scripts is still working.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

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
community guidelines
Adobe Community Professional ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

Thanks very much for all your help @Laubender, I have looked through everything you suggested and I did find some scripts close to my topic, but nothing that shows how to do what I want.

 

At this point I will have to accept that this is simply not something that the Indesign scripting API provides access to.

- Mark

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
community guidelines
Adobe Community Professional ,
Jul 01, 2022 Jul 01, 2022

Copy link to clipboard

Copied

LATEST

For now, there seems to be no solution. I have created this feature request. Feel free to upvote.

- Mark

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
community guidelines