Copy link to clipboard
Copied
hi!
may someone can help me?
i'm working daily with a grep expression witch becomes longer and longer and so the risk of errors becomes bigger.
what i need to do:
search for:
\<([\d]+([\.,][\d]+)*)([Different types of spaces]?)([Word1|Word2|…Word20)\>
replace with:
$1~S~<$3
Problem:
The list of words should be edited by other users and can contain caracters like € or ² – because of this i was thinking of something like a file with tab separated words.
In the replace with expression are to different spaces underlined – before doing the search and replace i always need to decide what to use and modify the search accordingly.
I would love to do this choice by a radiobutten.
Any ideas how i can realize this?
I just started to learn javascript so using external txt files for defining a variable is not really within my skills now.
Copy link to clipboard
Copied
FindChangeByList
Have you looked at this script? May not be exactly what you like with an actual user interface...
Regards
Romano
Copy link to clipboard
Copied
hi romano!
thanks for your reply.
yes i have had a look on FindChangebyList but the mentioned text file with the search words needs to be edited by different people without of any grep-knowledge.
thomas
Copy link to clipboard
Copied
Hi Thomas
I have spent the last week or so to rewrite the Find Change script into a CEP plugin.
I did this to find out how the new CEP platform works. I would not claim I mastered it yet. But I learned a lot about how not to do it.
I would imagine that the interface for the script could take the kind of features (radio buttons etc) you want.
Do you have a budget for this? Let me know and maybe we can spec this so it does some simple things for starter and then build on it.
Regards
Romano
Copy link to clipboard
Copied
whats a CEP plugin?
Copy link to clipboard
Copied
Hello,
Here is a grep / find replace with a UI.
Also a very nice write up.
P.
Copy link to clipboard
Copied
thanks, but thats not what i need.
Copy link to clipboard
Copied
Thomas, a picture says more than 1000 words …
First of all ([\d]+([\.,][\d]+)*) could a bit simplified: (\d+([.,]\d+)*) or maybe this work too: (\d[^\s]+)
Then you should provide some real examples. ([Different types of spaces]?)([Word1|Word2|…Word20) isn’t really helpful.
So built a idml-example and a example with your textfile and provide those files for download to all scripters here.
From where should the script collect your textfile (same folder as the .indd?)
What is the name of this file?
Do you want to search the whole document or a selection?
– Kai
Copy link to clipboard
Copied
Hi Kai!
Thanks for your response.
In two days i will be back home - then i can provide some real world examples.
As for now here is, more exact, what i want to do:
I like to search for a (random) number with a unit.
I don’t now the number and the unit, for example „km²“ is defined in the text file.
Sometimes there is a space between the number and the unit – but this space can’t be search by \s because tabs should be ignored.
The script should provide the possibility to insert a nonbreaking space or a thin space.
The text file can have a name like units1.txt and should be inside of a separate folder within the script folder.
I like to search in the whole document.
Thomas
Find more inspiration, events, and resources on the new Adobe Community
Explore Now