Forum Replies Created
-
AuthorPosts
-
Masood Ahmad
ParticipantHi Damyanto / Abbas,
I think I have achieved what is expected. The code has been tested on InDesign CS5 and is working fine.
Here are the steps:
1. create a Paragraph style for the Complex script (i.e. Arabic) with Arabic font-set (for example: Adobe Arabic Regular Font)2. create a Character style for the Latin script (i.e. English) with Latin font-set (for example: Myriad Pro Regular Font, character direction Left-to-Right, etc)
3. Create first New GREP Style in the Paragraph Style, Apply the Character style (created for the latin script) and enter code1 in the ‘To Text’ field:
code1:
([\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}])+4. Create second New GREP Style in the Paragraph Style, Apply the Character style (created for the latin script) and enter code2 in the ‘To Text’ field:
code2:
([!”‘()-./\:;<=>\[\]^_`~\{|\} ](?=[\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}]))+5. Create third New GREP Style in the Paragraph Style, Apply the Character style (created for the latin script) and enter code3 in the ‘To Text’ field:
code3:
((?<=[\x{0023}-\x{0026}]|[\x{002A}-\x{002C}]|[\x{0030}-\x{0039}]|[\x{003F}-\x{005A}]|[\x{0061}-\x{007A}]|[\x{00A9}])[!”‘()-./\:;<=>\[\]^_`~\{|\} ])+Now the BIG Question… What this code will do???
The code will search for latin text i.e. A-Z, a-z, 0-9 and all special characters surrounded by latin text and will apply the Character Style. In real scenario, the user can directly type Arabic text using the Paragraph style and as soon as he type any English text, the code will automatically apply the Character style for the English text. Therefore, the user doesn’t have to manually change the font for the English text.Thanks Damayanto and Abbas for raising this issue. I’ll too use this code till Adobe comes up with something.
February 11, 2014 at 1:57 am in reply to: Create a list of anything that uses a certain paragraph/character style #67105Masood Ahmad
ParticipantHello Alexandro,
If I have not misinterpret, you need a script to create an Index. I think Indiscripts have something for you, also listed other useful links:
https://www.indiscripts.com/post/2011/11/indexmatic-frequently-asked-questions
https://creativepro.com/building-an-index-using-character-styles-or-external-word-list.php
Masood Ahmad
ParticipantHi, I think this will help you…
GREP Find What:
\+\d+\+Change Format:
Icons character styleThe code will find all the digits whether 1 or many before and after the plus sign.
Masood Ahmad
ParticipantI think the question was asked by Damayanto and we mistakenly acknowledge to Abbas :)
Masood Ahmad
ParticipantAbbas, I have been working with Right to Left Languages from the past 15 years. I’m a linguistic operator by profession. I too cam across the same problem while working in InDesign. I am working with InDesign ME (Middle East) since CS2. InDesign lacks the ability to define two fonts for the same paragraph. The “https://s13.postimg.org/9ggyhsfnr/word_para.gif” shows the screen grab from MS Word which has this feature since its beginning (with Language support). The ‘Complex Scripts’ font drop-down list controls the font for the Right-to-Left Languages example: Arabic, Urdu, Persian, Dari, Hebrew etc whereas ‘Latin text’ controls the font for the Left-to-Right languages example: English, French, etc. Hope Adobe, will bring some relief to us in his next launch someday; David, please pass this information to Adobe.
When I come across such problem, I define the main Font for the complex script in my paragraph style and creates a character style for the latin text.
Secondly, you can change the language of your complex script to something like “Arabic” and then you can easily apply some GREP or Find/Replace for the latin language ‘English UK’.David, can you give us some GREP code to apply formatting to a definite language, lets say ‘English UK’. We can use that code in our para style to automatically apply the character style to our latin text or vice-versa.
Masood Ahmad
ParticipantHurray…. I got it… Here is the script…
tell application “Adobe InDesign CS5”
tell active document
set applied language of every story to “English: UK”
set tracking of every story to 0
end tell
end tellMasood Ahmad
ParticipantHave you check whether the text is visible in Preview mode. If not then there could be couple of possibilities, some of which are listed below, please try these:
1. Uncheck the ‘Nonprinting’ text box attribute from Windows>Output>Attributes.
or
2. Check if there is any object on top of the text with ‘Overprint Fill’ attribute. In this case the text will only be visible under Overprint Preview mode.
February 6, 2014 at 1:47 am in reply to: Execute spell checking in indesign CS3/CS4/CS5/CS6 Before closing document using #66990Masood Ahmad
ParticipantHello, does anyone found something related to this?
Masood Ahmad
ParticipantThanks David, I will try to figure out something from Peter’s expression. Once again Thanks.
Masood Ahmad
ParticipantThere is no specific text I can give you right now, for instance you can take any text…
ABC is a US-owned company with over 40 years experience in the creative industries. The company is ISO 9001 certified and employs over 600 designers, graphics artists and editorial production staff at 3 studios in India.
In the above given text I would like to ignore digits and words like “and”, “ISO” and apply a character style (Bold) to the remaining.
The idea behind this is that I want to know whether it is possible to skip any particular text using GREP or not.
Masood Ahmad
ParticipantAny help …..
Masood Ahmad
ParticipantMark, in addition to Hopsa, please try this if you do not want to include the brackets []
(?<=\[)\d+\:\d+(?=\])
This will work both ways i.e. either with Find/Replace command or with Paragraph/GREP styles.
Masood Ahmad
ParticipantIt seems I am missing something or unable to understand what Justin is trying to say. I tried both ways i.e. a para ending with or without a punctuation, the grep mentioned by Justin in #34463 “\d(?=(\d\d\d)+\D)” is working fine. Also the Jongware’s expression is giving me the same output both ways.
Here is my Input and Output:
Text before Find and Replace command:
ABC is a US-owned company with over 40 years 12345678 experience in the creative industries. We provide 12345 mission critical, creative production services to 123456 newspaper and magazine publishers, 123456 corporations, catalogue retailers, SME’s, packag 123456789 and 1234567890 pre-media companies 123456789
58787878ABC is a US-owned company with over 40 years 12345678 experience in the creative industries. We provide 12345 mission critical, creative production services to 123456 newspaper and magazine publishers, 123456 corporations, catalogue retailers, SME’s, packag 123456789 and 1234567890 pre-media companies 123456789.
58787878.Text after the Find and Replace command using the expression:
Find:
\d(?=(\d\d\d)+\D)
\d(?=(\d\d\d)+(?!\d))Replace with:
$0 (with space after $0)ABC is a US-owned company with over 40 years 12 345 678 experience in the creative industries. We provide 12 345 mission critical, creative production services to 123 456 newspaper and magazine publishers, 123 456 corporations, catalogue retailers, SME’s, packag 123 456 789 and 1 234 567 890 pre-media companies 123 456 789
58 787 878ABC is a US-owned company with over 40 years 12 345 678 experience in the creative industries. We provide 12 345 mission critical, creative production services to 123 456 newspaper and magazine publishers, 123 456 corporations, catalogue retailers, SME’s, packag 123 456 789 and 1 234 567 890 pre-media companies 123 456 789.
58 787 878.I think what finally matters is the output, which has been achieved. Happy GREPing…
Masood Ahmad
ParticipantThanks Justin. I am just a beginner. I checked both the expressions (given below), both are working fine even if the numbers are at the end of a paragraph with or without a period. I tested it both way i.e. with paragraph style and with Find/Change.
Here is the text I was using for testing purpose:
ABC is a US-owned company with over 40 years 12345678 experience in the creative industries. We provide 12345 mission critical, creative production services to 123456 newspaper and magazine publishers, 123456 corporations, catalogue retailers, SME?s, packag 123456789 and 1234567890 pre-media companies 123456789.Find:
(\d\d\d)(?=\d)Replace:
$0and
Find:
\d(?=(\d\d\d)+\D)Replace:
$0 or character styleMasood Ahmad
ParticipantHi Justin,
I am also trying my hands on the GREP and while checking your code at my end, I found that “(?<=\d)\d\d\d(?!\d)” expression will only find the last three digits from a list of numbers. For example in a number 123456789, the expression will only select 789, i.e. the last three digits and it will then move on for the next search.
However, if you use your GREP expression shown above “\d(?=(\d\d\d)+\D)” in the Find What panel and replace it with the character style, you just suggested above, then the search will find all the groups of 3 digits starting from the ending position. For example in a number 123456789, it will become 123 456 789.
Hans, in addition to Justin, I would like to add a GREP expression, in case you need to create a 3 digit group from the beginning of the numbers, For example: 1234567, it will become 123 456 7.
Grep Find:
(\d\d\d)(?=\d)Grep Replace:
$0 (please note that there is a space after $0)Thanks
-
AuthorPosts
