Forum Replies Created
-
AuthorPosts
-
Paul White
MemberAnyone?
Paul White
MemberJust found the problem after I sent the last message.
When I copied the code from this site it must of add a space at the end or something. If I delete anything after the last character of the code including the last ) and re-enter ) after the then it works.
Even the first code
^(.+?)(.+?)
works now.
Strangely, when I copied your code yesterday and used the grep tab is was erroring on cannot find match. Sorry for being a pain but got there in the end and is now in my bank of useful grep codes.
Just so I know to do 3 words its
^(.+?)(.+?)(.+?)(?=)
thanks for your help Peter
Paul White
MemberSorry Peter for not being clear on whats happening.
I know how grep works and how to test it, I just don’t know enough how to write the code.
I did do I a find and replace [grep tab] and its highlights the text’, I did copy the text from this thread back into the document as I know you used this to create the code.
Just to be sure I copied the text into my grep document which as a paragraph styles with working grep codes attached, just to check it wasn’t a document issue.
I even checked there was no character style active which I know sometimes overrides the paragraph styling. I am at a bit of a loss
its a shame I can’t attach a screen shot!
Paul White
MemberNo probs Scott.
I thought it related similar to your original question.
However, just tried it in a clean document and still can get it to work :(
The reasoning for the code does help, some of which I have never seen before. So thank you.Paul White
MemberI have come up with the idea to add a grep into the tier 2 paragraph style to remove the tab, pagenumber and return characters
\d+\r
or at least the
\r
so I can keep the tab and turn off page numbers from tier 1.
My only problem is telling grep to remove this and not just find it, unless the only option is to manually do a find and replace.
Can anyone confirm this or know if you can tell grep in a paragraph style to remove what it finds?
Paul White
MemberHi Peter I don’t doubt you one bit… but for some reason either one works in my document?
???
Can i send you the file just in case I am being a dumb a%$$?
Paul White
MemberHi Peter thanks for your reply. It doesn’t work on my document
John Bishop has been married to his wife Melanie since 1993, with an 18 month separation that began in 2000.[22][23] They have three sons: Joe, Luke, and Daniel.[22][24] They live in Cheshire.[25]
John Bishop enjoys playing football and is an avid Live etc….
Looking at making the first ‘ 2 words’ of a paragraph style grep character style.
Am I missing something?
Paul White
MemberI could do with some help as well with Grep which is similar query!
How do you do the first 2 words at the start of a paragraph. I think I am having a memory block today?
Paul White
MemberI did have a look at this problem found on the site here.
[url]https://creativepro.com/fixing-toc-levels-that-refuse-to-behave.php[/url]but found it was still dropping in level 2 before level 1.
It was 2 separate text box frames and the only way around it was to keep it all on one single text frame.Something worth remembering when creating these sorts of TOC and not a bug after all
Paul White
Membertested it and runs a treat.
nice one.
Paul White
MemberThanks Peter and Keith
I have used the new script on this project and works great. I put in filled image placeholders to represent size and shape of a product until the images are ready to import and usually forget to remove the background, so this script is a great timing saving check before going to print.
Is there away to modified this to script a book not just a document?
Paul White
MemberThe only way to do this is have 2 separate master pages.
One called A-Cover, B-Layout. You can rename master page titles if it makes it easierPaul White
MemberI actually found the easiest way to control this was to use index within indesign. Doh! feel so stupid.
Paul White
Memberfixed the curly quotes but still getting syntax error on line 3.
it was the space between -1;var myDoc = app.activeDocument; var myRectangleArray = myDoc.rectangles.everyItem().getElements(); for (var j = myRectangleArray.length -1; j >= 0; j--) { var myItem = myRectangleArray[j]; if ((myItem.graphics.length >0 ) || (myItem.images.length > 0)) { myItem.fillColor = myDoc.swatches.item("None"); } }
This works great! The above code works if anyone else needs it and thank you for everyone input.
Now do I tell it to look for all these in a book not just a single document?Paul White
Memberstill getting the same error :(
var myDoc = app.activeDocument; var myRectangleArray = myDoc.rectangles.everyItem().getElements(); for (var j = myRectangleArray.length – 1; j >= 0; j--) { var myItem = myRectangleArray[j]; if ((myItem.graphics.length >0 ) || (myItem.images.length > 0)) { myItem.fillColor = myDoc.swatches.item(“None”); } }
can anyone have a quick look please?
-
AuthorPosts