Back

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

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • Kathy Cote
    Member

    Hi,
    ok I got!

    myFrame=newDoc.textFrames.add();
    myFrame.contents = c;
    myFrame.geometricBounds = [0,0,1,w];

    Kathy Cote
    Member

    Hi,
    I try to run the following script. The script will create the new InDesign document from a .txt file. It names new files according to their sizes, save and close. It works.

    Before closing, I would like to create a new text frame for each of the created files with the information of the third column [2] (or variable “c”). There is indeed a new text frame but I failed to insert my text “c”. I’m sure the problem is my variable but I can’t fix it.

    I have a .txt file with 3 columns et 50 lines.

    someone of you have the solution?

    Your help is greatly appreciated,

    Kathy

    This is my code:
    var file = File.openDialog(“Select Your Text File”, undefined, false);
    var folder = Folder.selectDialog(“Select the folder where the new documents should be saved”);
    file.open(“r”);
    var content = file.read().split(“”);
    var pageIndex;

    for (var i = 0; i < content.length ; i++) {
    var curLine = content[i].split(“”);
    var w = curLine[0];
    var h = curLine[1];
    var c = curLine[2];

    docName = w + “X” + h + “_” + c ;

    try {
    var newDoc = app.documents.add(false);
    newDoc.documentPreferences.pageHeight = h;
    newDoc.documentPreferences.pageWidth = w;

    newDoc.save(new File(folder + “/” + docName + “.indd”));

    if (pageIndex==undefined)pageIndex=0;
    var newTextFrame=newDoc.pages[pageIndex].textFrames.add();
    newTextFrame.newDoc=c; //it does not work

    newDoc.close(SaveOptions.no)
    } catch(myError){}
    }

    in reply to: How to create a series of texte frame using values from txt file #88756
    Kathy Cote
    Member

    Hi,
    I usually use the data merge but it is a bit complicated if I want to use data merge with 50 different document formats.

    I have a script that can create all my new Indesign documents with a .txt file. In those new documents, I want to create multiple automatic text frame.

    Thanks ;-)

    Kathy

    in reply to: Create batch of new documents #88717
    Kathy Cote
    Member

    ok everyone, I’m sorry. I saw my error.
    Everything works well!

    Thanks

    in reply to: Create batch of new documents #88703
    Kathy Cote
    Member

    I try to modify the code but it seems to be a problem.
    I would use a .txt file with 3 columns and to use numbers with decimals.
    Ok I added the code to the 3 columns but I do not know how to modify the code to use numbers with decimals. And my other problem is that the script seems to only read the first line in the .txt file. The script does not give me an error but does not work completely.

    does anyone know?

    Example of my text in the .txt file:
    33 66 1569
    55 22 1256
    5.5 10.5 8956
    33.5 33.5 5842
    33.5 33.5 9856

    and this is my code:
    var file = File.openDialog(“Select Your Text File”, undefined, false);
    var folder = Folder.selectDialog(“Select the folder where the new documents should be saved”);
    file.open(“r”);
    var content = file.read().split(“”);

    for (var i = 0; i < content.length – 1; i++) {
    var curLine = content[i].split(“”);
    var w = curLine[0];
    var h = curLine[1];
    var c = curLine[2];

    docName = w + “X” + h + “_” + c ;
    try {
    var newDoc = app.documents.add(false);
    newDoc.documentPreferences.pageHeight = h;
    newDoc.documentPreferences.pageWidth = w;
    newDoc.save(new File(folder + “/” + docName + “.indd”));
    newDoc.close(SaveOptions.no)
    } catch(myError){}
    }

    in reply to: swap text with specific paragraph style #88365
    Kathy Cote
    Member

    Hi Peter,
    I just want to say thank you. That script is amazing!

    in reply to: Create batch of new documents #88359
    Kathy Cote
    Member

    Hi Ari,
    I want to say thank you, it works! WOW!

    The only thing is, I can only use whole numbers. I would like to be able to use example: 45.5 X 45.5

    Is it possible ?

    Thanks ;-)

    in reply to: swap text with specific paragraph style #88180
    Kathy Cote
    Member

    Hi,
    I have bilingual flyers. Sometimes the french text is in first and the English text is after the French. But I have to do another version of this flyer, but with English text in first, and the French after the English.

    in reply to: Delete Specific Layer #88122
    Kathy Cote
    Member

    So nice, thank you!

    in reply to: Pasteboard preferences #87750
    Kathy Cote
    Member

    Amazing ! It works very well! thanks you so much! Thanks you all!

    in reply to: Pasteboard preferences #87595
    Kathy Cote
    Member

    Hi,
    I would like to change the horizontal and vertical margins pasteboard in the preferences (not the margins in the page).

    in reply to: Create batch of new documents #87491
    Kathy Cote
    Member

    Hi Ari,
    Thank you very much for your help. I really appreciate.
    I only have a small problem with the script. I can not make it work.
    I was wondering if you could help me with that ?

    This is the JavaScript Error:
    Error Number: 25
    Error String: Expected: )

    Engine: main
    Line: 7
    Source: for (var i = 0; i < content.length – 1; i++) {

    Offending Text: ;

    Again thank you for everything ;-)

    Kathy

    in reply to: Export All Open Doc to JPG #86087
    Kathy Cote
    Member

    Thank you to everyone for your help! it works great!

    in reply to: Export All Open Doc to JPG #85985
    Kathy Cote
    Member

    oh wow it works! Thanks a lot! I really appreciate your help.

    I have one more question …
    Sometimes I have documents with one page and others with multiple pages. If it is a document with multiple pages, do you know if it’s possible to export all page, per page for all open documents?

    Thanks

    in reply to: Script to Export PDF per Page? #85842
    Kathy Cote
    Member

    oh you’re so nice !

    Thanks a lot!

Viewing 15 posts - 16 through 30 (of 30 total)