Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Script to automate layout creation

Tagged: , , ,

Return to Member Forum

  • Author
    Posts
    • #88959

      This is my first post on this forum. I’m not a good english speaker, so please excuse my mistakes. Yet I hope to make myself understood better.

      I searched all over the internet for a script to help me in my everyday work, but I found nothing.
      I work in advertising and everyday, I make ad pages. I work with layouts. The vast majority of scripts are for texts, not for layouts. I need something to make my job easier, to somehow automate repetitive operations that take too long.

      Essentially I need a script to resize the picture frame (not the content) to the edges of the page.

      E.g:
      I have a page that contains 3-4 images and a headline. Let’s say that it is a master, of which I have to make 200-300 different sizes.
      I use the “Scale” function with great pleasure, and it automatically resizes my page content. But the proportions are different. In Excel I ordered all sizes depending on the ratio. I started scaling from square ratio to landscape ratio. On every scaling, the content is automatically resized, and on the sides there remain free spaces that I manually have to fill. So, I drag each frame in part to the page margins. The images inside are big enough to fill the spaces.

      When the “Liquid page” function was introduced in InDesign, I was happy, believing it could help me in way, but it didn’t. Instead I was inspired to create this script. I think that, as the liquid page did, I may be able to assign some attributes to a frame, for example, it extending to the left, right, up or down. You can also select one frame and assign these functions, exclusively for each frame, and after scaling, you may press a button to run that script, which will expand the frames to the page margins.

      It is possible to make a script to do this?

    • #88969

      Hi Dragos,

      what is mising, if you turn on Liquid Layout > Page Rule > Object-based, content Autofit, Object constraints: height or width ??

      A script would do the same thing?

      Kai

    • #89002

      Thanks Kai for your response, but I’m afraid it does not work.

      I have not found a way by which LL to do what I need.
      He scales the content. I don’t want that, but ONLY the frame.

      ex
      start with a 297×210 (1.png)
      new size must be 400×250 (2.png)
      at the end I need to adjust the frame size (not content) to the page size (3.png)

      Images can be found here:
      https://www.dropbox.com/sh/f15sawfzn0yz2rv/AACNWg15FL9YcK9DdzBmCQjta?dl=0

      thanks
      Dragos

    • #89006

      Dragos, I’m not sure, if I understand this correct! It would be better, if you provide a idml-file before, with wrong scaling, with correct scaling.

      However: Your screens doesn’t show object based LL-Rules. That means,
      – Select the page tool
      – Click with the black arrow on the graphic frame, while the page tool is selected
      – Open the Liquid layout panel
      – Set handles for width and anchor to top

      Normally there is no scaling, if you do it in this way.

      And important: Don’t click on Auto-Fit!

      Kai

    • #89007

      I didn’t know that with LL you can resize the frame. That’s new. Thank you.
      But again, did not help me, because in this case scales only the frame to the new page size, not the image.
      They can work together?

      I added 2 new image on dropbox and IDML

    • #89010

      Dragos, you should spent some more love to your examples. Otherwise I have no interest to help you here!

      You wanted something, that anchors your frame to the new page edges, but doesn’t scale the image. But your example on page 2 shows a scaled image, that fits to the heigth and I’m not sure, where the different width comes from.

      Said: It is clear to you, how the final output should look like. That’s maybe not the case for the readers here.

      I could write such a script for you. But first, you should think of a solution out of the box.

      Kai

    • #89165

      Kai, here you misunderstood me: “You wanted something, that anchors your frame to the new page edges, but doesn’t scale the image”

      I said from the beginning that I want to extend the frame AFTER I scale the image to the new dimensions of the page.
      Please read my first post again. I think it is quite easy to imagine the workflow.

      I don’t want anyone to waste time here.
      If you have 5-10 minutes, we can have a skype. I think this way we understand better. At this moment I want this script more than anything else. I have big plans and I am interested to develop in the future, of course if you’re willing to help me.

      Thanks

    • #89166

      Dragos, please sent me a detailed example with all steps between the startpoint and final result to infoATruebiarts.de.

      Kai

    • #89276

      Hai, below is a link to a pdf of the entire workflow

      https://www.dropbox.com/s/sulp3ni40onelit/workflow.pdf?dl=0

      Thanks

    • #89395
      Brian Pifer
      Participant

      Hi Dragos,

      Something like this should work for the first part of the problem you’re trying to solve. It assumes you have the main frame you want resized selected with the black arrow. It should resize the frame to the edge of the page. I don’t have much familiarity with bleeds so couldn’t help you too much there. Hopefully this is a useful start.

      var theDoc = app.activeDocument;
      var theSelection = app.selection[0];
      var bounds = [0, 0, theDoc.documentPreferences.pageHeight, theDoc.documentPreferences.pageWidth];
      theSelection.geometricBounds = bounds;

    • #89439

      Hi Brian,

      Thanks for this.
      Unfortunately, I can’t run the script. Hase this error:
      https://www.dropbox.com/s/9p5c4mys8qlnt64/Screen%20Shot%202016-10-31%20at%2010.22.55.png?dl=0

      I copied the code that you sent me in TextEdit, and I changed the extension in .jsx
      https://www.dropbox.com/s/583bfvnlivnf4k0/Screen%20Shot%202016-10-31%20at%2010.24.23.png?dl=0

    • #89452
      Brian Pifer
      Participant

      Hi Dragos,

      Not sure where the “vtsnsinsicpg…” line would be coming from, if the code I provided is the only thing in the .jsx file, unless you have another script that is appending some kind of root filename into other scripts. Sorry I can’t be of more help.

    • #89460

      Hi Brian,

      Indeed, it seems that something was not right. I tried on another computer and it works.
      But the script expands the frame to the size find in “Document setup”, which is not the same page size,
      because it was modified by Page Tool.

      Can be changed so that frames to be scaled to the real page size, not one that is found in the “Document setup”?

    • #89461

      Dragos, this isn’t the flexibility as you described, but try changing:

      theSelection.geometricBounds = bounds;

      to

      theSelection.geometricBounds = theSelection.parentPage.bounds

Viewing 13 reply threads
  • You must be logged in to reply to this topic.
Forum Ads