• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Text Replacement script

New Here ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

Hello all,

I am very new to the scripting world but have an issue that I was unsuccessful in resolving myself through googling and searching around. It may be impossible due to illustrator's set up but I am looking for a script to find and replace strings of text throughout a document. I realize in indesign this would be easy as all get out, but due to other limitations I am forced to use Illustrator.

I would need the script to search and find strings in both text boxes and text objects (or 2 scripts could work). I would be looking for something to find and replace as well as style for instance, find AA and replace with AA(registration mark) and superscript the registration mark. I would need to be able to do this for multiple instances of this string on a document. Is something like this possible?

Thanks in advance!

TOPICS
Scripting

Views

4.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Jan 30, 2017 Jan 30, 2017

Votes

Translate

Translate
Adobe
People's Champ ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

These threads are helpful:

Trouble applying paragraph and character styles to text in Illustrator with a script

Re: RegExp search and replace, keep original text formatting

For your script it looks like you can create some kind of customized ScriptUI input box in which you can assign what characters or words get some graphic style - or manually styled via script by changing the baselineShift property of a characterAttributes of a textRange. Here's an example:

2017-01-30 11_47_42-Untitled-1_ @ 439% (RGB_Preview).png

#target illustrator

function test(){

  var doc = app.activeDocument;

  var t = doc.textFrames[0];

  alert(t.characters[0].characterAttributes.baselineShift); // 0 - no superscript

  alert(t.characters[1].characterAttributes.baselineShift); // 3 - superscript is at 3 units

};

test();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

Hi, robertouell !

You may try my extension panel – that born from topic that Silly-V​ was wrote above – now I just updated it to suit your needs

Short demo video

Repository

Installation zxp file

Install using ZXPInstaller

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

Wow that looks super useful!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

Video unavailable...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2019 May 18, 2019

Copy link to clipboard

Copied

LATEST

Nice work, thank you for sharing!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 31, 2017 Jan 31, 2017

Copy link to clipboard

Copied

Wow thank you all for your input and help! I definitely think what has been said will aide me. Will have to dive into it later this week and see what I can do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines