Copy link to clipboard
Copied
I have text frame with content (lets suppose) "Hello, Mike". Is there any way to make to manipulate what is inside the text frame by csv file. I know there are Variables, but variables modify whole object, what I need is to make like this: "Hello, $(name)", and access this name variable?
This involves work with text ranges, and first you have to turn your special syntax template string into an Illustrator TextRange object. Check out this long-ago thread which goes in depth regarding exactly what you are looking for:
https://community.adobe.com/t5/illustrator/regexp-search-and-replace-keep-original-text-formatting/m-p/8440571?page=1
For my personal project this simple code was enough:
var replacer = "Mark";
var content = "hello, @name!"
var modContent = content.replace("@name", replacer);
Copy link to clipboard
Copied
This involves work with text ranges, and first you have to turn your special syntax template string into an Illustrator TextRange object. Check out this long-ago thread which goes in depth regarding exactly what you are looking for:
https://community.adobe.com/t5/illustrator/regexp-search-and-replace-keep-original-text-formatting/m...
Copy link to clipboard
Copied
For my personal project this simple code was enough:
var replacer = "Mark";
var content = "hello, @name!"
var modContent = content.replace("@name", replacer);
Copy link to clipboard
Copied
Oh yes that will take care of the basic needs - I had a hablit in my head from some recent work where it was important to maintain a style of characters - so in that respect most of the thread I linked does overcomplicate it.