I'm going to be making images that include hundreds of lines of text of varying lengths, each of which will have the same "background", with the exception of the length of the background, which will need to be relative to the length of the text. I want to not have to manually fit text to a box each time.
The second twist is that I want the background to be reduced opacity, but I want the text to be 100% opacity.
So the text will always be the same size and solid white, over a (say) 80% opacity orange background. The "padding" (inset?) on all four sides of the text the text will be constant relative to the text. All that will change is the overall width of the text string, consistent with the overall width of the "box".
I have reviewed these two answers
which would seem to address this but don't quite. I am using Illustrator CS6.
As for fitting text boxes to text.. see the script in your first question link. That's the only method I'm aware of.
The fill issue is MUCH easier to solve.
Set this up once, then drag the whole thing to the Graphic Styles Panel. When you need to apply this same appearance, simply select the Area Text box and then click the style in the Graphic Style Panel.
Note, the background is relative to the Area Text box... if the box changes size, the background will as well.
The script does kill the appearance. So here's what I would do...
Set up the Graphic Style and save it.
Have an Area text box set up and ready for the script.
Now create a new Action and start recording...
- Run the script
- click the Graphic Style
Assign an F key to the action.
Now all you need do is select an Area Text Box and hit the assigned F key. If the text box needs resizing while working, just tap the F key.
Illustrator has, and has had, a bug where scripts in actions are concerned. The action will not retain the script step if you quit Illustrator. So each time you launch Illustrator you would need to set up the action again. It's annoying, time consuming and a pain. However, recreating the action each time it's needed may be much faster than manually manipulating text boxes and appearances.