Back

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

Forum Replies Created

Viewing 15 posts - 1,156 through 1,170 (of 1,338 total)
  • Author
    Posts
  • in reply to: GREP to find numbers with curly quotation marks #52217

    (Having a slight deja-vu — GREP with hyphens with various numbers? But let me repeat it here, in case someone else has the exact same question.)

    Search for

    (?<=d)”

    Replace with

    ~”

    The search works because it looks for “a digit on the left”, followed by any sort of double quote — typing ” in a Search expression will have InDesign automatically look for both straight and curly, both open and closed, double quotes.

    The replace works because usually InDesign automatically translates a single ” into the required open or closed double curly quote, but the notation ~” means it should not do that and insert a literal double “.

    … Make sure each frame ends with a hard return, or preferably even a Break Frame character … Perhaps that's what's messing your frames up …

    If it is, I might be able to insert Frame Breaks where needed with the script.

    in reply to: More plates than I should have #52226

    File contains 2 placed illustrator files (CMYK, but only used black and spots) …

    Isn't that the trigger — CMYK? (You don't mention it, but you must be using Yellow somewhere as well.)

    Good! — One thing left to do, here is a version that changes the last hard return into a Frame Break, or in case there is no return, adds the break.

    Man I need to learn how to script.

    Why not have a go thinking of something you'd like to script and see how far you get? The JS Guide over at Adobe's (InDesign section, “Scripting Stuff” button) has a lot of snippets for common tasks, so you can cut 'n' paste entire sections to make something new. And there always is the Adobe Scripting forum for the odd question left.

    Anyway, here is the amended script. The changed section is around the “combine me with next” clause.

    var combineMe = new Array;

    for (a=0; a<app.selection.length; a++)
    {
    if (app.selection[a] instanceof TextFrame)
    combineMe.push(app.selection[a]);
    }
    combineMe.sort (function (a,b) { return (a.geometricBounds[0] < b.geometricBounds[0]) || (a.geometricBounds[0] == b.geometricBounds[0] && a.geometricBounds[1] < b.geometricBounds[1]) ? -1 : 1; } );

    for (a=0; a<combineMe.length-1; a++)
    {
    if (combineMe[a].nextTextFrame == null)
    {
    nextFree = a+1;
    while (nextFree < combineMe.length && combineMe[nextFree].previousTextFrame != null)
    nextFree++;
    if (nextFree < combineMe.length)
    {
    // Add Frame Break when needed:
    if (combineMe[a].characters[-1].contents != SpecialCharacters.FRAME_BREAK)
    {
    if (combineMe[a].characters[-1].contents == “\r”)
    combineMe[a].characters[-1].contents = SpecialCharacters.FRAME_BREAK;
    else
    combineMe[a].insertionPoints[-1].contents = SpecialCharacters.FRAME_BREAK;
    }
    combineMe[a].nextTextFrame = combineMe[nextFree];
    }
    }
    }

    Hmmm … Testing, it appears to do exactly what I was intending: frames get linked top to bottom, and if the tops are equal, left to right. Can you switch on “Show Text Threads” and check if that's correct?

    Remember: it doesn't destroy any existing links, so that's why you might get something you didn't expect — see also my image above.

    Under normal circumstances, this is the result of linked six frames that are perfectly aligned:

    Left to right, top to bottom threading

    Hey, no prob. I enjoy solving little problems like this ;-)

    Try this one for size. Select any amount of unlinked (!) text frames in any screen order, and they'll get linked, top to bottom, left to right. The script will not mess up any existing linked frames, even if some are already linked — it'll skip these and link to their first/last frames instead:

    Linked frames, before and after

    var combineMe = new Array;

    for (a=0; a<app.selection.length; a++)
    {
    if (app.selection[a] instanceof TextFrame)
    combineMe.push(app.selection[a]);
    }
    combineMe.sort (function (a,b) { return (a.geometricBounds[0] < b.geometricBounds[0]) || (a.geometricBounds[0] == b.geometricBounds[0] && a.geometricBounds[1] < b.geometricBounds[1]) ? -1 : 1; } );
    for (a=0; a<combineMe.length-1; a++)
    {
    if (combineMe[a].nextTextFrame == null)
    {
    nextFree = a+1;
    while (nextFree < combineMe.length && combineMe[nextFree].previousTextFrame != null)
    nextFree++;
    if (nextFree < combineMe.length)
    combineMe[a].nextTextFrame = combineMe[nextFree];
    }
    }

    (Ed.: Forum didn't like font changes :-P Restored to normality — I hope)

    Here is a script, specially written for you! It links any two text frames (obviously, only if they are not already linked) in top-down left-right order.

    Make sure each frame ends with a hard return, or preferably even a Break Frame character!

    if (app.selection.length == 2)
    {
    a = app.selection[0];
    b = app.selection[1];
    if (a instanceof TextFrame && b instanceof TextFrame)
    {
    if (a.geometricBounds[0] > b.geometricBounds[0])
    {
    a = app.selection[1];
    b = app.selection[0];
    } else
    if (a.geometricBounds[0] == b.geometricBounds[0] && a.geometricBounds[1] > b.geometricBounds[1])
    {
    a = app.selection[1];
    b = app.selection[0];
    }
    if (a.nextTextFrame == null && b.previousTextFrame == null)
    a.nextTextFrame = b;
    else
    alert (“Oops …”);
    } else
    alert (“Oops …”);
    } else
    alert (“Please select two text frames”);

    … Make sure each frame ends with a hard return, or preferably even a Break Frame character … Perhaps that's what's messing your frames up …

    If it is, I might be able to insert Frame Breaks where needed with the script.

    Hmmm … Testing, it appears to do exactly what I was intending: frames get linked top to bottom, and if the tops are equal, left to right. Can you switch on “Show Text Threads” and check if that's correct?

    Remember: it doesn't destroy any existing links, so that's why you might get something you didn't expect — see also my image above.

    Under normal circumstances, this is the result of linked six frames that are perfectly aligned:

    Left to right, top to bottom threading

    Hey, no prob. I enjoy solving little problems like this ;-)

    Try this one for size. Select any amount of unlinked (!) text frames in any screen order, and they'll get linked, top to bottom, left to right. The script will not mess up any existing linked frames, even if some are already linked — it'll skip these and link to their first/last frames instead:

    Linked frames, before and after

    var combineMe = new Array;

    for (a=0; a<app.selection.length; a++)
    {
    if (app.selection[a] instanceof TextFrame)
    combineMe.push(app.selection[a]);
    }
    combineMe.sort (function (a,b) { return (a.geometricBounds[0] < b.geometricBounds[0]) || (a.geometricBounds[0] == b.geometricBounds[0] && a.geometricBounds[1] < b.geometricBounds[1]) ? -1 : 1; } );
    for (a=0; a<combineMe.length-1; a++)
    {
    if (combineMe[a].nextTextFrame == null)
    {
    nextFree = a+1;
    while (nextFree < combineMe.length && combineMe[nextFree].previousTextFrame != null)
    nextFree++;
    if (nextFree < combineMe.length)
    combineMe[a].nextTextFrame = combineMe[nextFree];
    }
    }

    (Ed.: Forum didn't like font changes :-P Restored to normality — I hope)

    Here is a script, specially written for you! It links any two text frames (obviously, only if they are not already linked) in top-down left-right order.

    Make sure each frame ends with a hard return, or preferably even a Break Frame character!

    if (app.selection.length == 2)
    {
    a = app.selection[0];
    b = app.selection[1];
    if (a instanceof TextFrame && b instanceof TextFrame)
    {
    if (a.geometricBounds[0] > b.geometricBounds[0])
    {
    a = app.selection[1];
    b = app.selection[0];
    } else
    if (a.geometricBounds[0] == b.geometricBounds[0] && a.geometricBounds[1] > b.geometricBounds[1])
    {
    a = app.selection[1];
    b = app.selection[0];
    }
    if (a.nextTextFrame == null && b.previousTextFrame == null)
    a.nextTextFrame = b;
    else
    alert (“Oops …”);
    } else
    alert (“Oops …”);
    } else
    alert (“Please select two text frames”);

    in reply to: The perfect GREP pattern for URLs #55192

    There is no such beast :P

    Every time I thought I found “the definitive GREP” something else popped up — latest major addition was support for “?” queries, and that opened another can of snakes. Best you can hope for is “something that works 80% of the time”, I think.

    As for Casey's problems,

    Some issues that came out of Casey's post were (1) avoiding the full-stop if the URL is at the end of a sentence, and (2) including any slashes that appear at the end of a URL.

    (1) No problem if you only allow a period inside, that is, it always should be followed by a alphanumeric.

    (2) Also no problem — all you need to do is end with “/?”

    You can build something up from this, for starters:

    (http|ftp)://[a-zA-Z][a-zA-Z0-9]+.([a-zA-Z_0-9]+.)+[a-zA-Z_]+(/[a-zA-Z_0-9.]+)*/?

    – it found all 7 URLs in the document I happened to have on my screen right now.

    (Ed. Hah. Didn't address Casey's #1 — never allow a period end. Some shuffling around will solved that, tho'.)

    in reply to: The perfect GREP pattern for URLs #52195

    There is no such beast :P

    Every time I thought I found “the definitive GREP” something else popped up — latest major addition was support for “?” queries, and that opened another can of snakes. Best you can hope for is “something that works 80% of the time”, I think.

    As for Casey's problems,

    Some issues that came out of Casey's post were (1) avoiding the full-stop if the URL is at the end of a sentence, and (2) including any slashes that appear at the end of a URL.

    (1) No problem if you only allow a period inside, that is, it always should be followed by a alphanumeric.

    (2) Also no problem — all you need to do is end with “/?”

    You can build something up from this, for starters:

    (http|ftp)://[a-zA-Z][a-zA-Z0-9]+.([a-zA-Z_0-9]+.)+[a-zA-Z_]+(/[a-zA-Z_0-9.]+)*/?

    – it found all 7 URLs in the document I happened to have on my screen right now.

    (Ed. Hah. Didn't address Casey's #1 — never allow a period end. Some shuffling around will solved that, tho'.)

    Not possible … GREP styles only work on “real” text. Internally, a text variable is represented by one single (albeit wide) character.

    It's the same as with Initial Caps and Nested Styles — these also “see” an entire variable as a single character. It's also the reason that automatic headers run amok when they're too wide for their own frame.

    I wonder if this got solved in CS5.

    in reply to: INDD and PPT..HELP!!! #55188

    What sort of notes are you talking about, exactly? (a) Footnotes; (b) InDesign Notes (showing the lil' triangly thingys); (c) your own personal notes, which InDesign carelessly considers “plain text”?

    … Export as RTF? Not sure if PP can import that.

Viewing 15 posts - 1,156 through 1,170 (of 1,338 total)