Back

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

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • in reply to: problem importing illustrator Interlace into indesign #14375128

    I am getting the pixelation too even when placing the AI file in inDesign.
    To get it to work go back to Illustrator and then: Object > Expand and resave.

    For anyone interested the script below will insert footnote numbers back into all footnotes.


    var scriptName = File($.fileName).name;
    app.scriptPreferences.enableRedraw = false; //Does not seem to work in this case

    Application.prototype.main = function() {
    var theDoc = app.activeDocument;
    var theStory;
    try{
    theStory = app.selection[0].parentStory;
    }
    catch(e)
    {
    alert("Place cursor i story with footnotes and try again");
    exit();
    }
    var theFootnotes = theStory.footnotes.everyItem().getElements();
    var theCounter = 0;

    //progressbar setup
    var w = new Window('palette', 'Inserting footnote numbers ...', {x:200, y:200, width:350, height:70});
    w.pbar = w.add('progressbar', {x:25, y:12, width:300, height:12}, 0, theFootnotes.length);
    w.st = w.add('statictext', {x:10, y:36, width:320, height:20}, '');
    w.st.justify = 'center';
    w.show();

    //new temporary footnote
    var tempNote = theStory.insertionPoints[-1].footnotes.add();

    //Select and copy text from the temp footnote
    var theFootnoteNumber = tempNote.texts[0]; //includes both the number and the following tab character
    app.select(theFootnoteNumber);
    app.copy();

    // remove temp footnote
    tempNote.remove();

    //iterate existing footnotes and insert footnotenumber
    for (var i = theFootnotes.length-1; i >= 0 ; i--) {
    app.select(theFootnotes[i].paragraphs[0].insertionPoints[0]);
    app.paste();
    theCounter++;
    w.pbar.value = theFootnotes.length-i;
    w.st.text = "Processing item " + w.pbar.value + " of " + theFootnotes.length + " total";
    }
    alert("Inserted footnote number in " + theCounter + " footnotes.");
    }
    app.doScript('app.main();',ScriptLanguage.JAVASCRIPT,undefined,UndoModes.ENTIRE_SCRIPT,scriptName);

    Dang! That block quote tag sure is effective. Sorry for screaming.

    in reply to: GREP find in between nuances #14335719

    Hi

    In stead of using .+? which is greedy
    try using .*?

    in reply to: Current Page #14323252

    Yes, Theunis
    activePage is a handy property for getting that one specific page.
    The only thing that bothers me about this is that if you have your zoom fit to spread then the active page is automatically set to the left one. Even if you have a selection on the right hand page. To make the right hand page the active one I must move the spread a bit to the left.
    It could be that I am doing something wrong, but this has bothered me so much that I would rather get the current page from a selection on the page.

    in reply to: Current Page #14323266

    There is also the parentPage property of a textFrame. Handy if your script is looping through many pages .

    For instance this :

    var currentPage = myParagraphs[i].parentTextFrames[0].parentPage;

    would set the currentPage variable to the page of the paragraph’s initial insertionPoint.

    In much the same manner you could find the current page of a character, a textstyle range, a footnote, a note, an anchored object etc.

    in reply to: Make an array of H&J violations for processing with script #14323525

    Hmmm,
    I found the width of an unjustified space by finding the horizontalOffset.

    in reply to: Make an array of H&J violations for processing with script #14323526

    Hi Peter

    Thanks for the answer. I was afraid that would be the case.

    How would you go about picking up the width of a character?

    in reply to: Script to move images to seperate layer #112973

    Hi William

    You must move the parent of the graphic and not the graphic itself. The parent is the frame containing the graphic.
    And then I believe you need to loop through each of them to do so. (Maybe there is a smarter way than looping.)

    var theDoc = app.activeDocument;
    var theGraphics = theDoc.allGraphics;

    if(!theDoc.layers.item (“images”).isValid){
    var imgLayer = theDoc.layers.add({name:”images”}); //adding layer if it is not present
    }
    else {
    var imgLayer = theDoc.layers.item(“images”);
    }

    for (var i = 0; i < theGraphics.length; i++) {
    theGraphics[i].parent.itemLayer = imgLayer;
    }

    in reply to: Script to change the language of all text on document #82986

    I have actually just written this script to accomplish what you asked for:

    Application.prototype.main = function() {

    if (!app.documents.length < 1 ){
    var theDoc = app.documents[0];
    var theParagraphStyles = theDoc.allParagraphStyles;
    }
    else{
    alert(“You need an open document to run this.”);
    exit();
    }

    var myDialog = app.dialogs.add({name:”Change global language in all paragraph styles”, canCancel:true});
    var myLanguages = app.languagesWithVendors.everyItem().name.sort();
    myLanguages.splice (0,0, myLanguages[myLanguages.length-1]);
    myLanguages.pop();

    try{
    with(myDialog)
    {
    with(dialogColumns.add())
    {

    with(borderPanels.add())
    {
    staticTexts.add({staticLabel:”Change language to “});
    var myLanguagesDropDown = dropdowns.add({stringList:myLanguages, selectedIndex:0});
    staticTexts.add({minWidth:25});
    }

    }
    }// End of the dialog box

    }//End of try
    catch(e){alert(e + ” Just another error”);}

    var myResult = myDialog.show();

    if(myResult == true){
    for (var i=1;i<theParagraphStyles.length;i++){
    theParagraphStyles[i].appliedLanguage = myLanguages[myLanguagesDropDown.selectedIndex];
    }
    }
    else{
    exit();
    }
    }
    app.doScript(‘app.main();’,ScriptLanguage.JAVASCRIPT,undefined,UndoModes.ENTIRE_SCRIPT, “Change language in all paragraphstyles”);

    in reply to: Weird text cropping bug in dialog boxes – CC #71616

    Hmmm… yeah that fixed it.

    For now, I guess.

    It has been years since I had to clear the prefs. Maybe I should do it more often :-)

    in reply to: Is it possible to find the end of line with grep? #64500

    Thanks, Eugenyus

    Yes that kind of works.
    But it does not work very well in paragraphs where hyphenation is off. I get some very short lines now because of some words being pulled down to the next line. Is the hair space a non breaking character?

    I would still like to be able to swap the anchor marker and the space before it. That gives me the best result in all situations here.

Viewing 12 posts - 1 through 12 (of 12 total)