Forum Replies Created
-
AuthorPosts
-
May 17, 2020 at 8:10 am in reply to: GREP Tricks: Using LookBehind and LookAhead expressions to convert a SPACE into a NON-BREAK SPACE #1250934
Peter KahrelParticipant\K is for positive lookbehind only as far as I know. The classic lookbehind doesn’t handle variable-length arguments, so you can’t use operators like + and *. But in your case you can enumerate the options, in which case you can use the classic lookbehind:
((?<!ABCDE)(?<!FGH))XYZ
Peter KahrelParticipantThe spaces that you see between the left edge of the text frame and the first characters of the two paragraph (the B and the F) are the left sidebearings of the characters: that space is part of the character the way it’s defined in the font. Therefore you can’t use left indent or whatever. The only way to get align the visible part of the letters at the frame’s edge is to insert an innocent and invisible character such as a discretionary hyphen before the first letter and apply kerning between the two. You can automate that, see
https://creativepro.com/files/kahrel/indesign/kern.html#kern_first_character
P.
Peter KahrelParticipantLook again at David’s expression, where he has a code for ‘any punctuation’. Combine that with yours and you get
[[:punct:]](?=~%)April 16, 2020 at 2:11 am in reply to: JavaScript for InDesign article Simple Script Runner #1238723
Peter KahrelParticipantJust for the record: Edward discovered that it was a problem with InDesign’s preferences. After deleting them the scripts worked as expected.
Peter KahrelParticipantExcellent!
Peter KahrelParticipantFile received in good order, thank you. After I opened the book and all its documents (apart from the first two, which shouldn’t change) I ran the one-line script and all documents were renumbered correctly. I’ll send a screenshot of the before and after books to your email, I can’t attach it here. You did you open the documents, did you not?
P.
Peter KahrelParticipantI can’t imagine that corruption plays a role. If any of your documents were corrupt, InDesign wouldn’t be able to open it or if it did, would probably crash.
If you zip up your files and send then to pkahrel@gmail.com I’ll have a look.
P.
Peter KahrelParticipantI can’t imagine that corruption plays a role. If any of your documents were corrupt, InDesign wouldn’t be able to open it or if it did, would probably crash.
If you zip up your files and send then to pkahrel@gmail.com I’ll have a look.
P.
Peter KahrelParticipantInDesign can’t export to Photoshop. You can try via PDF or EPS/AI, but what that does to layers I’ve no idea.
Peter KahrelParticipantBut the one you’ve been using changes the documents to number automatically… You are using this one, correct?
app.documents.everyItem().sections[0].continueNumbering = true;
And it’s the page numbers that should be targeted, not any other type of numbering — correct?
P.
Peter KahrelParticipantOne last thing you can try: use the script to change the document to automatic numbering, and save all the documents. Then in the book panel’s flyout, select Update Numbering, then All Numbers (or Update Page and Section Numbers, whichever you prefer). Does that work?
Peter KahrelParticipantBy the way, Edward, coming back to your earlier query about saving documents: the script only changes the setting in the Numbering & Section Options window, nothing else. You need to save all the documents yourself.
P.
Peter KahrelParticipantStrange. After running the script, when you go to a document’s Numbering & Section Options window, which button is selected? ‘Automatic Page Numbering’ or ‘Start Page Numbering at’? Please check more than one document.
Peter KahrelParticipantI think I understand the problem: you need to enable the book’s automatic page numbering: in the book’s fly-out menu (click the three small horizontal lines at the top-right of the book panel), select Book Page Numbering Options and check the automatic page numbering. That should do the trick.
I could add that as a second line to the script, but then it would no longer be a one-liner!
-
AuthorPosts
