Current width of the page (no Document) and height with JSX

Hello

I am trying to create a script that saves all pages in the document and adds the name of its width and its height.

So far, I managed to get the dimensions of the document to help:

app.activeDocument.pages.documentPreferences.pageWidth;

app.activeDocument.pages.documentPreferences.pageHeight;

It's ok when all pages in the document have the same dimensions (Document preferences).

However, when I use custom pages that does not work.

I tried the code below, but does not work either.


for (i = 0; i < nb; i ++)

{

app.activeDocument.pages [i].documentPreferences.pageWidth;

app.activeDocument.pages [i].documentPreferences.pageHeight;

}

I did some research and I don't seem to find all the information about the dimensions of the custom pages.

Can you please help with that?

Thanks in advance,

ISKO

Main();

function Main() {
    var doc = app.activeDocument,
    pages = doc.pages,
    page, width, height;

    for (var i = 0; i < pages.length; i++) {
        page = pages[i];
        width = page.bounds[3] - page.bounds[1];
        height = page.bounds[2] - page.bounds[0];
        $.writeln("Page: " + page.name + " - " + "width = " + width + ", height = " + height);
    }
}

Tags: InDesign

Similar Questions

  • Create and size the width of the path points... With JSX script possible?

    Hello

    I want to points of width of a path of script (for example, to create width marks on a path that can be manually changed by the width tool).

    This same question was asked in 2012:

    A 'Point width' on a PathItem script

    But it seems that it was not possible at the time.

    Is this possible in 2016?

    Thank you!

    M

    I don't think it is available for the script, but you can make a solution of crazy workaround where you write to the file

    C:\Users\{user}\AppData\Roaming\Adobe\Adobe Illustrator 20 Settings\en_US\x64\VariableWidthProfiles

    appropriate channels (pleasure).

    The string will look like a lot to one of the Actions:

    {/ collection7}

    {/Attributes}

    / VariableWidth_ProfileType 0

    / VariableWidth_Distances [22

    3020302e343338393431313730333537333732203120 (0.438941170357372 0 1)

    ]

    / VariableWidth_Widths [38

    302e303837393939373735393936373237203120302e30383739393937373539393637323720 (0.087999775996727 1 0.087999775996727)

    ]

    / CollectionName [14

    57696474682050726f66696c6531 (width Profile1)

    ]

    }

    /canEdit 0

    /canDelete 0

    }

    When the hex-decoded, they show all the necessary info, but I don't know what relates to what.

    Well, let's say if it is possible to write the text and the thing seems refreshed in the drop-down list of variable width (probably does not in this way), you have to apply the stuff to paths if necessary. Then you can write at least one action: the generic action triggered to be recorded by any changes made to the race is the action of 'The Stroke value' which, among other things, can affect the variable name as seen in the screenshot here.

  • Width of the page on pc in wider than my mac chrome

    website works fine on chrome on pc until I have use the menu to scroll backup that I noticed that the width of the page is wider and the photos aren't width full page but do not have this problem on my mac. I've attached a screenshot of the site after I used anchors menu to scroll to the top you can see that the photos are not full-width, even if they are muse and on my mac? screen grab.jpg Zak Williamson (Adobe)

    What I see in Chrome, is that if the browser window is narrower than the content (therefore a horizontal scroll bar is present when the page is loaded) the 100% browser width is the width of the browser window and not the width of the content, so scroll to the right shows fill browser white to the right of the element of browser 100% width.

    It sounds like a browser bug where Chrome is not manipulating the CSS of the element width 100% correctly or Chrome believes that the content of your page is larger that any other browser seems to think it is. (The horizontal scroll bar in Chrome is displayed in window widths wider than in other browsers).

    If you send me your .muse file to [email protected] as well as a link to this topic, I'll see that it gets looked liked so we offer workaround for Chrome or write a bug for the Chrome team, or both. If the file is larger than 20 MB, you can use a service like Adobe SendNow, Dropbox, WeTransfer, etc. (if you use a service, please include your email address in the body of the message back, given that not all services to include it in the invite sharing they send.) Thank you.

  • I deleted the links to Documents and photos on my start page.

    I deleted the links to Documents and photos on my start page. Link names are still there, but they are going nowhere. How is it possible to recreeate the new links that are actually going to My Documents and pictures? I also cleaned my basket so that is no longer an option.

    Try this to return to the system settings to before you changed anything.

    Restore point:

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    http://www.windowsvistauserguide.com/system_restore.htm

    Read the above for a very good graph shows how backward more than 5 days in the System Restore Points by checking the correct box.

    See you soon.

    Mick Murphy - Microsoft partner

  • How to display the width of the page or the big screen in firefox 11 automatically?

    How to display the width of the page or the big screen in firefox 11 automatically? I know how to Ctrl +, ctrl - and ctrl 0, but is there a way to define 11 firefox to automatically set the page viewing by default "page width" or full screen (F11 not)?
    Help, please. Thank you.

    You can use an extension to set a page zoom and the size of the default font on the web pages.

  • I created a 22 page Indesign document and I am wanting to place it in muse as a book. How can I do this

    I created a 22 page Indesign document and I am wanting to place it in muse as a book. How can I do to do that.

    Its a simple 22-page document. Back to Earth with a yellow area single text on each page, such as a previous/next button on the bottom. I'm hoping to put it in muse on one page, instead of having to do an absurdly long page in muse. I want the next/previous buttons to work as well.

    Inside of InDesign, I have already selected "Digital Publishing", but am stuck now on what to do.

    I use Creative Cloud 2015 for Muse and InDesign.

    Any help will be appreciated. Once the Adobe online chat is open again, I will discuss with them, but by then, I expect to get help on the forum.

    You can try to use the composition for this where containers will include content and the triggers can include thumbnail images.

    Thank you

    Sanjit

  • Muse cut the part left my site when resizing the window of the browser for anything whether it is less than the width of the page

    When you use centering nychtemerales, Muse cut the left side of my site when re the sizing of the window of the browser for anything less than the width of the page, this also happens on mobile devices.  How can I keep the page focused but have content basically left stop when resizing or viewing on a mobile screen? I don't want the edge of the page to disappear on smaller screens and when you use a smaller window. I do not want to resize the entire site at a lower resolution. Thanks in advancearbubaproblem.jpg

    If the left is cut, then you have designed offshore from the left of the page mode Design of Muse. The blue guides indicate the edge of the page and a margin guide on the page. Rule zero is the left edge of the page.

    The page is not admissible it will focus as long that the browser is wider than the page. Then, she left aligned (on point zero on the sovereign in design mode).

  • How to convert merge documents and mailing for the docs individual pdf and each with a field record in the merge?

    How to convert merge documents and mailing for the docs individual pdf and each with a field record in the merge?

    What is an actual field or just a piece of static text somewhere? Whatever it is, you can't do this using the Split Document command. You will need to use a script custom read the value of this 'field' and use it during extraction of pages in the file.

  • Add columns empty tray to spread the table in the width of the page

    I'm working on a book of hundreds of individual tables, most of which should end by 504 points wide. At present, I the size of each column to the width wider input, subtract a total width of 504, divide by the number of columns in the gutter and then add and size a new column between each existing column.

    It must be scriptable, but I don't know a script. Does anyone know if there is already a script like this?

    Ken Benson

    (After re-reading your messages - I could have read more carefully the first time :))

    This new scriptlet is going more towards what you were asking. So that this works as expected, you resize all columns to its minimum width, leaving a lot of space on the right side. Click your cursor inside the table, and then run the script.

    I think he's following now exactly your current operating instructions - the current width of the table is subtracted from the space remaining (504 points), which is divided over gutter (NumColumns - 1) columns between existing ones.

    aTable = app.selection[0].parent;
    if (aTable.constructor.name == "Cell")
     aTable = app.selection[0].parent.parent;
    extraGutter = (504 - aTable.width)/(aTable.columns.length-1);
    for (a=aTable.columns.length-1; a>=1; a--)
    {
     aTable.columns.add(LocationOptions.BEFORE, aTable.columns[a], {width:extraGutter});
    }
    
  • Cannot attach email word documents get the message 'enable documents and data '.

    Cannot attach a word document to an email. I get the message 'Enable documents and data' and it says that it is disabled. Don't enter iCloud setting there is no Document and data parameter. Is it because I use a free version of work?

    Whether the app is the word document?

    You can view the document word on the iPad?

  • Search bar on the Macbook Air doesn't work, will allow me to load the pages of Favorites and links to these pages, but not let me google from the bar or manually enter Web sites, however, it works perfectly on the guest user

    Search bar on the Macbook Air doesn't work, will allow me to load the pages of Favorites and links to these pages, but not let me google from the bar or manually enter Web sites, however, it works perfectly fine on the guest user. Have you tried restarting and it still does not work.

    The problem should be solved now.

    Otherwise:

    OS X

    iOS

    Workaround for problems with the Safari address bar

    http://osxdaily.com/2016/01/05/fix-Safari-freezing-address-bar-use/

  • Error message: cannot create the folder C:\Documents and Settings\Marlon\Local Application BVRP Software\NetWaiting\MoHlog.txt Settings\

    I recently had a problem with the virus 'Restore Windows'. I was able to get rid of it with Malwarebytes antivirus scanner, but when I turn on my computer I get this error message.
    Cannot create the folder C:\Documents and Settings\ of Settings\Marlon\Local Application BVRP Software\NetWaiting\MoHlog.txt

    I'm no expert, but I feel that my C drive disappeared, or at least has been hidden. My documents, pictures and music files are all empty. My programs (start > all programs) have been removed and deleted the shortcuts on the desktop. When I go to my computer, my personal and shared document files are not accessible. Under the description it says that they are hidden. My local disk (c) is also empty, but there is still very little space which suggests that programs and files have not been deleted.
    Is it possible to recover my files?
    Thank you

    Hello

    MoHlog.txt file is related to the software of modem on the computer, you can uninstall and reinsta it check if it works.

    Also scan your computer for any infection by virus still present on the computer using any scanner online.

    You can also try the system restore to the point before that the computer has been infected by the virus and check if it helps.

    Good luck!

  • During the seizure of documents and emails, letters and spaces are missing at random.

    Original title: typing problems

    During the seizure of documents and emails, letters and spaces are missing at random. Takes forever to type anything.

    Hi lornabramley,

    Add already provided suggestions, try update the computer with the latest drivers, including drivers for the chipset. Log computer manufacturer site to do so.

    Answer whose status is so we can look for other options, if these suggestions do not help.

  • Screen of the blackBerry Smartphone will not portrait in landscape mode when, in the pages of sms and message mode change

    I don't know if I've accidentally changed something, but all of a sudden I can not get the screen to switch from portrait to landscape mode when im in the pages of sms and message. I searched everywhere for an option that could keep me out of this point of view, but I have not found anything. Anyone know how to fix this? your help will be greatly appreciated.

    Make sure that you use the latest version of the OS that you can find (from any carrier.)

    You can probably get it to work again by removing the battery and reinsert.

  • Cannot open the illustration. There is not enough room for the window; increase the area of document and try again

    Hello

    I'm under Illustrator CS6 on a Mac version 10.10.3. I created an Illustration and I accidentally did very little to save and close the window. Now whenever I open the file I get the error "unable to open the illustration. There is not enough room for the window; increase the area of document and try again. "This problem is specific to this file only - I can open all other correct files, and anyone who tries to open that particular file on a completely separate machine receives the same error. I read all the posts of people having the same error message, but their problem is different from mine because my problem is specifically limited to this file. I've trashed preferences, hidden and shown the toolbar Application and an open framework of other files and makes them great as possible, has the file open on the file menu, instead of double clicking, and none of these methods work.

    Can anyone help?

    Thank you so much in advance!

    Well, problem solved. For future users with this problem:

    Open a new document in Illustrator

    Press "F" to enter full screen mode

    File > open to open the file problem

Maybe you are looking for