Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
0

Multiple Variables in one Text Area or Text Field

Community Beginner ,
Mar 01, 2010 Mar 01, 2010


Is there a way to define different variables in one text area so that the line spacing between line will be consistent?


Or do I have to break the text area up into separate text fields?

(I searched the forum but didn't find an answer.)

TOPICS
Scripting
3.8K
Translate
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

LEGEND , Mar 24, 2010 Mar 24, 2010
It's pretty simple really. I am wondering if there is a way to have more than one variable in a textframe?

What do you mean by "variable"? Illustrator has a whole feature set in the UI called Variables. There's a dedicated Variables palette. If that's what you're talking about, then no, you cannot bind multiple variables to a single text object. The so-called data-driven Variables are bound at the object level.

If you're talking about the generic term "variable" in the sense of a scripting languag

...
Translate
Adobe
Community Beginner ,
Mar 05, 2010 Mar 05, 2010

Does anyone know how I can take text objects relating to a dataset and write a script to insert them into a new text field in a given order?

Any pointers would be helpful.

Thanks.

Translate
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
LEGEND ,
Mar 19, 2010 Mar 19, 2010

Describe more clearly and thoroughly exactly what you are trying to do.

JET

Translate
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 ,
Mar 24, 2010 Mar 24, 2010

Hi Jet,

It's pretty simple really. I am wondering if there is a way to have more than one variable in a textframe?

Basically, if I have a list of addresses and hours of operations in  a dataset. Right now they are broken into separate textframes. The other designer likes to have them all in one textfield, so that they can have the proper leading throughout. After doing some research it appears that there's no way to have many variables in one textframe. Is there something I am missing?

Thanks for writing.

Translate
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 ,
Mar 24, 2010 Mar 24, 2010

Hey,

I found this script to join textframes:

http://www.wundes.com/JS4AI/joinTextFrames.js

However, it's not working properly when it comes to formatting the characters. There isn't enough RAM on my machine at work?!? I think it has to do with the following line:

var basicStylesArray=['..'];

There are too many styles in the array and I am not sure which ones are relevant or irrelevant.

Or should I abandon this script and write my own?

Translate
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
LEGEND ,
Mar 24, 2010 Mar 24, 2010
It's pretty simple really. I am wondering if there is a way to have more than one variable in a textframe?

What do you mean by "variable"? Illustrator has a whole feature set in the UI called Variables. There's a dedicated Variables palette. If that's what you're talking about, then no, you cannot bind multiple variables to a single text object. The so-called data-driven Variables are bound at the object level.

If you're talking about the generic term "variable" in the sense of a scripting language, then yes, of course you can replace different text ranges within a single textFrame with the values of multiple variables--so long as the values of the variables in question are text. Or, you can use the text of text ranges in one or multiple textFrames as the values for multiple variables.

Or should I abandon this script and write my own?

Again, I have nothing more than a very vague and general description of what exactly you are trying to do. So, yes, given that the express purpose of that script is to merely concatenate the contents of several textframes into one, and that it's pretty elaborate, my guess would be that you should write your own.

Basically, if I have a list of addresses and hours of operations in  a dataset. Right now they are broken into separate textframes.

Again, you are using a term (dataset) that implies you are referring to Illustrator's Variables feature. If you are just talking about joining the text from multiple separate textFrames in Illustrator into one, you can do that in the UI without any script at all: Just copy the multiple text objects, get the Text tool and create a new text object, and paste.

If you need spaces, paragraph returns, or some other delimiter inserted at the start or end of the separate objects before joining them by normal means in the UI, you might want to take a look at the descriptions of the scripts here named JET_ConcatenateTextAtEnd and JET_ConcatenateTextAtStart.

JET

Translate
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 ,
Mar 25, 2010 Mar 25, 2010
LATEST

Hi Jet,

Yes you are right there is some ambiguity in what I wrote.

What do you mean by "variable"? Illustrator has a whole feature set in the UI called Variables. There's a dedicated Variables palette. If that's what you're talking about, then no, you cannot bind multiple variables to a single text object. The so-called data-driven Variables are bound at the object level.

If you're talking about the generic term "variable" in the sense of a scripting language, then yes, of course you can replace different text ranges within a single textFrame with the values of multiple variables--so long as the values of the variables in question are text. Or, you can use the text of text ranges in one or multiple textFrames as the values for multiple variables.

The original question about multiple variable in a textframe, refers to Illustrator's variable pallette. So you have clarified that for me, there is no way to have multiple variables in one textframe object since they are bound at the object level. That's a bit of a shame I think.

Again, I have nothing more than a very vague and general description of what exactly you are trying to do. So, yes, given that the express purpose of that script is to merely concatenate the contents of several textframes into one, and that it's pretty elaborate, my guess would be that you should write your own.

I was trying to work with this script called joinText by John Wundes, but styling all of the characters is too processor intensive for my computer at work! When I use it in a document with lots of styles, it crashed AI. When I use it in a file with only the two lines of text, it works fine. The script is looking at all the styles in the entire document I think.... or am I wrong?

Again, you are using a term (dataset) that implies you are referring to Illustrator's Variables feature. If you are just talking about joining the text from multiple separate textFrames in Illustrator into one, you can do that in the UI without any script at all: Just copy the multiple text objects, get the Text tool and create a new text object, and paste.

If you need spaces, paragraph returns, or some other delimiter inserted at the start or end of the separate objects before joining them by normal means in the UI, you might want to take a look at the descriptions of the scripts here named JET_ConcatenateTextAtEnd and JET_ConcatenateTextAtStart.

I did download your scripts a couple of weeks ago and have found them very useful. Thanks so much for posting them for download, they are great! - especially the two you have listed here. I think you're right, I'll have to do this part manually using copy + text tool. Unless I can think of a way to overcome the problems listed above.

I really appreciate you taking the time to answer my question.

Translate
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