Back

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

Forum Replies Created

Viewing 15 posts - 46 through 60 (of 106 total)
  • Author
    Posts
  • in reply to: Relink images based on page number #14323855
    Jeremy Howard
    Participant

    That could definitely be done. You would just need to grab the “name” of each page so that you can use it to build the file path with.

    I believe that the method for getting a page’s “name” is simply thisPage.name

    Jeremy Howard
    Participant

    Oh man, I hadn’t seen this before. This is the best OMV that I have seen online, by far.

    Thanks!

    Jeremy Howard
    Participant

    The main thing that we are missing in Visual Studio is the object model viewer. Without that, you need to use clunky online alternatives that are hard to navigate (especially for beginners)

    in reply to: Script to move all images(graphics) to a new layer #14324211
    Jeremy Howard
    Participant

    Give this a go and let us know how it works!

    var scriptName = “Images to layers”;
    if (app.documents.length == 0) ErrorExit(“Please open a document and try again.”, true);

    Main();

    function Main() {
    var myDoc = app.activeDocument;
    var myPageItems = app.activeDocument.allPageItems;
    var imageFrameArray = new Array();

    try{
    var myDestLayer = myDoc.layers.add({name:”Images”});
    }catch(foo){
    myDestLayer = myDoc.layers.item(“Images”);
    }

    for(var i = 0; i < myPageItems.length; i++){
    var aFrame = myPageItems[i];

    if(aFrame == “[object Group]”){
    var myGroupFrames = aFrame.allPageItems;
    for(g = 0; g < myGroupFrames.length; g++){
    var gFrame = myGroupFrames[g];
    //if the current frame is an image frame
    if(gFrame instanceof Rectangle || gFrame instanceof Polygon || gFrame instanceof Oval){
    imageFrameArray.push(gFrame);
    }
    }//end for g < myGroupFrames.length
    }else if(aFrame instanceof Rectangle || aFrame instanceof Polygon || aFrame instanceof Oval){
    imageFrameArray.push(aFrame);
    }
    }

    for(x=0; x<imageFrameArray.length;x++){
    var thisFrame = imageFrameArray[x];

    try{
    var myLinkedItem = thisFrame.pageItems[0];
    var myLinkName = myLinkedItem.itemLink.name;
    thisFrame.itemLayer = “Images”;
    }catch(foo){}
    }

    alert(“Finished.”, scriptName);
    }

    function ErrorExit(error, icon) {
    alert(error, scriptName, icon);
    exit();
    }

    in reply to: HOW TO: automate chat Layout with text from .txt file #14324242
    Jeremy Howard
    Participant

    Great video David, very well done! You definitely took it further than I had been envisioning!

    in reply to: Script for applying cell styles #14324247
    Jeremy Howard
    Participant

    Hello Deborah,

    As I read your post, I am wondering whether or not you have considered housing the table in its own text frame… If you did that then you could get rid of the stroke on the table and apply the stroke to the text frame that houses the table. The advantage to this would be that you could then apply the “Align Stroke To Outside” property in the Stroke panel and then the stroke would not interfere with the table’s contents in any way.

    What do you think? Could this work in your case?

    in reply to: HOW TO: automate chat Layout with text from .txt file #14324295
    Jeremy Howard
    Participant

    Well, I’ll be! It turns out that I had jumped to quickly to a scripted solution when there are indeed ways of doing this with a GREP find and replace… David, this is why you are the master!

    I began by creating a paragraph style named “Person 1” and I applied some paragraph border and paragraph shading options until I was fairly happy with the look. When doing this yourself, you will want to make sure that you pay attention to the “Corner Size And Shape” options (I rounded them a bit), the “Offsets” options (I increased mine a bit) and the “Width” option (I set mine to “text” so that it didn’t span the entire frame). In Addition to the shading, I suggest using the “space before” and/or “space after” settings to create some space between each of the messages.

    After I got the “Person 1” style set up more or less to my liking, I created a new “Person 2” style and based it on “Person 1” so that I only needed to change the color of the paragraph shading and the text justification and that style was done.

    Now that the two styles were set up, it was time go get to the GREP. Here are the strings that I used:

    In the GREP find field I entered: ^.+(Person 1).+$

    And then I chose the “Person 1” paragraph style in the “Change Format” dialog, clicked “Change All” and presto! All of the Person 1 messages were now styled as messages. A quick rinse and repeat to target the “Person 2” messages and the formatting was done.

    As far as placing images using text, I think that I posted a nice little script on InDesign Secrets as a response to a post a while back. I’ll see if I can dig it up!

    in reply to: HOW TO: automate chat Layout with text from .txt file #14324296
    Jeremy Howard
    Participant

    That is true, I hadn’t considered using a find change to accomplish this… I may need to enter the lab and see what I can cook up on this… If it turns out that you are right and I am able to figure it out then I will be sure to post the solution in this thread!

    in reply to: Grep Find\Change problem #14324297
    Jeremy Howard
    Participant

    Are you using multiple paragraph returns to space your paragraphs rather than using space before? If so, I have two things to say…

    First, tsk, tsk… don’t do that!

    Second, try this GREP: +(?=$)

    in reply to: Grep Find\Change problem #14324299
    Jeremy Howard
    Participant

    Try using this GREP string:

    +(?=$)

    The “$” is the symbol for the end of a paragraph

    in reply to: HOW TO: automate chat Layout with text from .txt file #14324302
    Jeremy Howard
    Participant

    Hello Jakob,

    Something like this would not be possible via any native InDesign features that I am aware of but this is absolutely possible via scripting. This is more than I am willing to do for free but I would be more than happy to point you toward resources where you could learn about scripting or we could potentially work out some sort of agreement…

    I will work on digging up some resources for you to look over, look for them in my next reply!

    in reply to: Batch convert Indesign page size script #117260
    Jeremy Howard
    Participant

    Hey Tim,

    I am so glad to have helped! Hopefully others will find this script useful as well!

    in reply to: “Canva”—what an absolute joke! #117189
    Jeremy Howard
    Participant

    I worked for several years at a printing press that ran some fairly old web presses and I haven’t seen anything produced by Canva that would cause problems for that older printing system. I have sent countless ads to press that contained rasterized text at 300 dpi without issue…

    My suggestion would be that if the printing company that you use can’t print these kinds of files cleanly then find yourself a new printer!

    Jeremy Howard
    Participant

    I would assume that it says 2017 because that is your default application for opening those file types.

    I don’t think it has anything to do with which version the client saved it in.

    in reply to: Batch convert Indesign page size script #117181
    Jeremy Howard
    Participant

    Here it is!

    This script will open InDesign documents that you have selected in Finder, open them, resize pages, save and close documents.

    Features:
    • Dynamic movement of page objects to keep them aligned to the bottom margin.
    • Works with unlimited number of documents.
    • Works on unlimited number of pages per document.

    Warning:
    This script saves the document in place so all of the selected InDesign documents will be overwritten. I recommend creating a copy of your files prior to running the script.

    ————————————————————–
    ———————–BEGIN SCRIPT———————–
    ————————————————————–

    (* set new dimensions for the pages that you will be batching *)
    set newDocHeight to 48
    set newDocWidth to 51

    (* select all of the files that you would like to convert *)
    tell application “Finder” to set theFiles to selection

    repeat with currentFile in theFiles

    (* opens each file in the default application – this will be whatever the latest version of InDesign is on your machine *)
    tell application “Finder” to open currentFile

    tell application “Adobe InDesign CC 2018”
    (* repeat/try combo checks to see if the front document is open. As soon as the script can set the active document as a variable this repeat will be exited *)
    repeat
    try
    set myDoc to active document
    exit repeat
    on error
    delay 1
    end try
    end repeat

    tell document preferences of myDoc
    (* get current page dimensions *)
    set startHeight to page height
    set startWidth to page width
    (* set page dimensions to our new dimensions *)
    set page height to ((newDocHeight & “mm”) as string)
    set page width to ((newDocWidth & “mm”) as string)
    end tell

    (* find the distance that the page items should be moved using the “roundThis” handler *)
    set xMovement to my roundThis(((newDocWidth – startWidth) / 2), 4)
    set yMovement to my roundThis(((newDocHeight – startHeight) / 2), 4)

    set docPages to every page of myDoc

    (* repeat through all pages in the document and move page items according to the math above *)
    repeat with thisPage in docPages
    move thisPage’s page items by {xMovement, yMovement}
    end repeat –Doc pages

    (* Save the document in place and close it *)
    tell myDoc
    save
    close
    end tell –myDoc
    end tell –InDesign

    end repeat –Repeat with currentFile in theFiles

    (* handler for rounding decimal places *)
    on roundThis(n, numDecimals)
    set x to 10 ^ numDecimals
    tell n * x to return (it div 0.5 – it div 1) / x
    end roundThis

Viewing 15 posts - 46 through 60 (of 106 total)