8 Replies Latest reply on May 14, 2010 6:01 AM by Wade_Zimmerman

    IL CS4 Variables to multiple objects

    zedleighton

      Hi.

       

      How can I bind several objects (on the same artboard) to a single, common, variable?

      The methods I've tried don't seem to work.

       

      This is what I've done:

       

      • Select multiple objects
      • Click "make text dynamic" (This created two instances in the Variables panel with the same title and content)
      • Click "Capture Data set"
      • Click "Save Variable Library"
      • Open XML file in notepad to reveal the following:

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"    "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd" [

      <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">

      <!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">

      <!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">

      <!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">

      <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">

      <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">

      ]>

      <svg>

      <variableSets  xmlns="&ns_vars;">

      <variableSet  locked="none" varSetName="binding1">

      <variables>

      <variable  trait="textcontent" varName="Variable1" category="&ns_flows;"></variable>

      <variable  trait="textcontent" varName="Variable1" category="&ns_flows;"></variable>

      </variables>

      <v:sampleDataSets  xmlns:v="&ns_vars;" xmlns="&ns_custom;">

      <v:sampleDataSet  dataSetName="Data Set 1">

      <Variable1>

      <p>Hello World!</p>

      </Variable1>

      </v:sampleDataSet>

      </v:sampleDataSets>

      </variableSet>

      </variableSets>

      </svg>

       

       

      • Edit the XML node "Variable1" from "Hello World!" to "WTF!"
      • Save the XML file and close
      • In IL click "Load Variable Library" and select the XML file

       

       

      Then I'm presented with a dialogue that reads "The incoming variable library is invalid"

       

      Am I doing something wrong? What should I do to bind several objects to one variable? Is it even possible to do so?

       

      BTW, I've read through the "variable" related posts in the forum but couldn't find an answer to this question. Apologies if it does exist and I've simply overlooked it.

        • 1. Re: IL CS4 Variables to multiple objects
          Wade_Zimmerman Level 6

          I do not think you can do this variables are intended to change specific data and is not an action type operation where you can make more than one data entity the same as another.

           

          The advantage of variables is that you do not have to replace the data once you have changed it you can simply call up the data set just by looking for the variable in a list. It is not the same as an action or script though it might be part of a script or action.

           

          The other advantange is that it can be populated by

          • 2. Re: IL CS4 Variables to multiple objects
            zedleighton Level 1

            Thanks for the reply, Wade.

             

            But if that's the case then it's very short sighted from the IL team.

            Disappointing.

            • 3. Re: IL CS4 Variables to multiple objects
              Mylenium Most Valuable Participant

              A variable name inside the same dataset must be unique for each object, only its values can be identical. Why it's producing duplicate code and declaring the variable twice, is mysterious, but well, AI is known to act strange. In any case, when you need to update multiple objects, you will need to define multiple variables, but you cannot bind them to the same data source, unfortunately. When editing the resulting file, make sure to not mess up the encoding, which is probably what happened. Edit the file in Dreamweaver or an advanced text editor like Notepad++ that can handle things like different LF CR on different platforms...

               

              Mylenium

              1 person found this helpful
              • 4. Re: IL CS4 Variables to multiple objects
                zedleighton Level 1

                The encoding was correct. I initially edited it in DW and got the same error message. It must have been the duplication.

                I guess I'll have to do things the hard way, then.

                 

                Thanks Mylenium.

                • 5. Re: IL CS4 Variables to multiple objects
                  Monika Gause Adobe Community Professional & MVP

                  Depending on waht you want to achieve, symbols might be an alternative. Have you thought about using symbols?


                  • 6. Re: IL CS4 Variables to multiple objects
                    zedleighton Level 1

                    Symbols wouldn't help.

                    If I want to have, for example, two text objects with identical content but one in Arial 20pt and the other Times 40pt, symbols won't do.

                    That's why I needed the variables.

                    • 7. Re: IL CS4 Variables to multiple objects
                      JETalmage-71mYin Level 3
                      function(){return A.apply(null,[this].concat($A(arguments)))}

                      How can I bind several objects (on the same artboard) to a single, common, variable?

                      Think of the bound object as a field in a database. Normally, you wouldn't have two different values assigned to one field. It's not uncommon, however, to have two instances of a single field on a particular form or layout.

                       

                      But this is XML based, not table-based. Per my admittedly very limited understanding of XML, each "field" or container or placeholder on the page is associated with one element in one position in the XML. So if you want the same "value" (element) to appear in two locations, you have to have two "fields" on the page and two occurrances of the element listed in the XML, just as you would have to in a web page's linear HTML text.

                       

                      function(){return A.apply(null,[this].concat($A(arguments)))}

                      If I want to have, for example, two text objects with identical content but one in Arial 20pt and the other Times 40pt...

                       

                      ...Then you would have to have two variables in the dataset containing the same values, bound to the two separate placeholders.

                       

                      I agree it's lame. My guess is that Illustrator's Variables function sees relatively little use, compared to the amount of use it would have received as a normal data merge feature based on ordinary tab-delimited data.

                       

                      But with XML all the rage a few years ago, I guess AI had to get on the XML bandwagon, too.

                       

                      JET

                      1 person found this helpful
                      • 8. Re: IL CS4 Variables to multiple objects
                        Wade_Zimmerman Level 6

                        I do not know if it is shorted sighted or not or if what you want to do is possible in any program but it is n interesting scenario of applying  variable data.

                         

                        But the function you want seems to me to be the function not of the variable but the Dat set contaiining tghe variable?

                         

                        At least that is my understanding for what ever it is worth.

                         

                        How did you envision this to function, why do see this as possible have you accomplished this prior to this attempt in any other application?

                         

                        Iwonder if the fields had a Character style applied if that did anything.

                         

                        Well I do not know all the ins and outs of variable and it is just my understanding which is limited.

                         

                        Good luck.