Back

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

Forum Replies Created

Viewing 15 posts - 1,291 through 1,305 (of 1,338 total)
  • Author
    Posts
  • in reply to: GREP search to increment numbers? #51193

    I considered using your GREP (so it would have been a full joint effort). But I think it would have been slightly less typework to search for

      (5[4-9]|[6-9][0-9]|10[0-4])

    GREP can't do proper number ranges but I can Laugh

    As a side note: I prefer using the Break code over not-groups. The Break code also works as marker at the start or end of a story or paragraph. Besides, the '+' in (?!\d+) is not necessary, and you forgot the equivalent (?<!\d) at the start of that long string.

    Is it me, or should all good GREP strings look like the ”$%#$!” one used to see in comics before they went “adult”?

    in reply to: GREP search to increment numbers? #51191

    Hey, Hank, I did not notice that 'in a certain character style'! ('dans une certaine condition', perhaps)

    Add this line somewhere after the findWhat line:

      app.findGrepPreferences.appliedCharacterStyle = “YourCharacterStyleNameHere“;

    to search for just those numbers. The rest of the script is, unlikely as it may sound, totally unaffected by this change — it merely now finds, and optionally changes, numbers that have the style applied.

    in reply to: image resizing #54207

    Eh, Fit Frame to Image?

    If you changed the scaling, select the inner area of the image with the white arrow and the control panel will show the scale percentages. Enter “100%” for both and then use Fit Frame to Image.

    in reply to: GREP search to increment numbers? #54206

    Hank, I don't have the remotest idea how you think it would add 1 to any of these numbers …

    David is right, of course — GREP Is Not Magic. It cannot do calculations, nor can it search an item from a list[*] and replace it with an equivalent from another list. You cannot have a similar list in the replace field.

    [*] Well, it can, using the OR | operator, but “Replace” doesn't know which item it found.

    Also, you can enter a 'range' in the Find field in the form [a-z] — this will find anything from 'a' to 'z'. But GREP does not know maths — you cannot search for [69-82]. (Go ahead, try. You will see it treats this as '6', '9-8', and '2' — and its anybodies guess what it will do with the malformed range in the middle.)

    A script to search and change the numbers in your range could be something like this (a rough attempt but it seems to work):

    //DESCRIPTION: Change some numbers and leave some else. In a selection as well.

    // A Jongware production. No guarantees.

    var ranges = [

    [54, 103, 1],

    [104, 178, 2]

    ];

    // step 0: verify selection

    if (app.selection.length != 1)

    {

    alert (“Well, I warned you to select something!”);

    exit();

    }

    // step 1: find ALL numbers

    app.findChangeGrepOptions = null;

    app.findGrepPreferences = null;

    app.findGrepPreferences.findWhat = “\d+”;

    numberList = app.selection[0].findGrep(true);

    // alert ('found '+numberList.length);

    // step 2: change certain ranges

    for (a=0; a<numberList.length; a++)

    {

    thisVal = Number(numberList[a].contents);

    for (b=0; b<ranges.length; b++)

    {

    if (thisVal >= ranges[b][0] && thisVal <= ranges[b][1])

    {

    numberList[a].contents = String(thisVal+ranges[b][2]);

    break;

    }

    }

    }

    // step 3: … erm. That's all!

    (David, how to format code?)

    in reply to: image resizing #51170

    Eh, Fit Frame to Image?

    If you changed the scaling, select the inner area of the image with the white arrow and the control panel will show the scale percentages. Enter “100%” for both and then use Fit Frame to Image.

    in reply to: GREP search to increment numbers? #51189

    Hank, I don't have the remotest idea how you think it would add 1 to any of these numbers …

    David is right, of course — GREP Is Not Magic. It cannot do calculations, nor can it search an item from a list[*] and replace it with an equivalent from another list. You cannot have a similar list in the replace field.

    [*] Well, it can, using the OR | operator, but “Replace” doesn't know which item it found.

    Also, you can enter a 'range' in the Find field in the form [a-z] — this will find anything from 'a' to 'z'. But GREP does not know maths — you cannot search for [69-82]. (Go ahead, try. You will see it treats this as '6', '9-8', and '2' — and its anybodies guess what it will do with the malformed range in the middle.)

    A script to search and change the numbers in your range could be something like this (a rough attempt but it seems to work):

    //DESCRIPTION: Change some numbers and leave some else. In a selection as well.

    // A Jongware production. No guarantees.

    var ranges = [

    [54, 103, 1],

    [104, 178, 2]

    ];

    // step 0: verify selection

    if (app.selection.length != 1)

    {

    alert (“Well, I warned you to select something!”);

    exit();

    }

    // step 1: find ALL numbers

    app.findChangeGrepOptions = null;

    app.findGrepPreferences = null;

    app.findGrepPreferences.findWhat = “bd+b”;

    numberList = app.selection[0].findGrep(true);

    // alert ('found '+numberList.length);

    // step 2: change certain ranges

    for (a=0; a<numberList.length; a++)

    {

    thisVal = Number(numberList[a].contents);

    for (b=0; b<ranges.length; b++)

    {

    if (thisVal >= ranges[b][0] && thisVal <= ranges[b][1])

    {

    numberList[a].contents = String(thisVal+ranges[b][2]);

    break;

    }

    }

    }

    // step 3: … erm. That's all!

    (David, how to format code?)
    
    
    		
    	
    in reply to: Plug-in/Script to convert US eng to UK or CAN eng #54162

    You can make a list of the different spellings and put that into the standard FindChangeByList script — that'll take care of 'realise', 'colour', 'mailbox', and their 'ilk' ('like').

    For the 'grammar', however, it's unlikely one will ever find a computerized solution. It would boil down to translating from one language to another. If you check Google Translate, you will see their only choice is plain 'English' — no dialects available.

    in reply to: Plug-in/Script to convert US eng to UK or CAN eng #51157

    You can make a list of the different spellings and put that into the standard FindChangeByList script — that'll take care of 'realise', 'colour', 'mailbox', and their 'ilk' ('like').

    For the 'grammar', however, it's unlikely one will ever find a computerized solution. It would boil down to translating from one language to another. If you check Google Translate, you will see their only choice is plain 'English' — no dialects available.

    in reply to: What's your work field? #54142

    Ah — you must have missed https://creativepro.com/for&#8230;..-do-you-do

    (Perhaps I should amend my little story with “hanging out on the forum too much” :-P)

    in reply to: From InDesign tables to Excel? #54141

    Roland, this “script” (it's a single line!) will convert all tables to text, separating the columns by a comma, and the rows by a hard return. It's a javascript, so save it with a “.jsx” extension.

    app.activeDocument.stories.everyItem().tables.everyItem().convertToText (",", "r");
    in reply to: What’s your work field? #51137

    Ah — you must have missed https://creativepro.com/for&#8230;..-do-you-do

    (Perhaps I should amend my little story with “hanging out on the forum too much” :-P)

    in reply to: From InDesign tables to Excel? #50802

    Roland, this “script” (it's a single line!) will convert all tables to text, separating the columns by a comma, and the rows by a hard return. It's a javascript, so save it with a “.jsx” extension.

    app.activeDocument.stories.everyItem().tables.everyItem().convertToText (",", "\r");
    in reply to: Pasting copy from a PDF into Idd #54039

    @Jesserenko Yes, GREP would certainly do what I want, especially if I can figure out how to keep double returns from being replaced so I won't lose the true paragraph return.

    Try this: (?<=[^r]) *r(?=[^r]) — replace with a single space.

    In its essence, it should search for at-left-not a return, any number of regular spaces (including none at all), a single return, at-right-not a return.

    Since copy-and-paste often introduces some space before carriage returns, you need to allow for zero or more spaces before that return.

    in reply to: Pasting copy from a PDF into Idd #50995

    @Jesserenko Yes, GREP would certainly do what I want, especially if I can figure out how to keep double returns from being replaced so I won't lose the true paragraph return. 

    Try this: (?<=[^\r]) *\r(?=[^\r]) — replace with a single space.

    In its essence, it should search for at-left-not a return, any number of regular spaces (including none at all), a single return, at-right-not a return.

    Since copy-and-paste often introduces some space before carriage returns, you need to allow for zero or more spaces before that return.

    in reply to: Convert Freehand MX to InDesign #54032

    Freehand is an illustrator program, and it's quite unlikely you can 'convert' artwork to native InDesign stuff.

    However, it should not be necessary. I don't think you can import (“Place”, in Indesign's parlance) native Freehand documents in InDesign (– have you tried?), but it should be possible to save the original files as something you can place in ID: Adobe Illustrator AI, PDF, or (when all else fails) EPS.

    Adobe on Freehand: “No updates to FreeHand have been made for over four years, and Adobe has no plans to initiate development to add new features or to support Intel-based Macs and Windows Vista.”

    If you want to be able to edit the files in a more modern package, try converting it to Illustrator instead. That should not be a problem at all, since Illustrator is an artwork design package as well. You can try opening the original file immediately, or use one of the other file types as above.

Viewing 15 posts - 1,291 through 1,305 (of 1,338 total)