Adobe Illustrator Variable Data – The EASY way!

SUPER-DUPER Update: I’ve completed a 2.5 hour course on how to use the NEW Variable Importer 8.0 script, and it’s available on Lynda.com! Click to check out more info on the Adobe Illustrator Variable Data Lynda.com course!

And now back to our in-progress blog post…


Previously, I wrote up a tutorial for an easier method to use Adobe Illustrator’s Variable Data feature. By easier, I meant easier than the procedure outlined in the official Adobe documentation.

This time, I’m back with an even easier method, if you can believe that. Recently, I was contacted by Vasily Hall, an script/automation expert who has developed a script for Illustrator called Variable Importer.

I go through it fairly quickly in the video above, but read on for a bit more in-depth walkthrough

What Is Variable Importer?

The Variable Importer script enables you to automate many of the previously annoying aspects of the usual methods of importing variable data into Illustrator.

The top issues resolved with the script are:

There are many more little niceties within the script, so let’s go ahead and take a look.

Get The Variable Importer Script

02-github-raw

First we have to get the script installed in Illustrator. To do this, first go to the VariableImporter script home on GitHub.

Once you get there, click on “VariableImporter.jsx”, then click the “Raw” button (shown in screenshot above). This will bring up a page that contains the raw code of the script. From here just “Save as…” from your browser to download (don’t just right-click the “VariableImporter.jsx” and save, because that way will introduce errors into the script – make sure to only save the “raw” code).

You’ll see another script there, too called “RenameArtFromText.jsx”. If you’re interested in doing multiple data sets up on a sheet then grab this one, as well.

Now place the file in your Illustrator Scripts folder and restart Illustrator (or choose to load it each time using the Other Script command).

On my Mac, the location of the Scripts folder is:

/Applications/Adobe Illustrator CS6/Presets/en_US/Scripts (yours may also be inside a “en_GB” folder or other if you have a different language installed).

On the Windows installs I had access to the path was

\Program Files\Adobe\Adobe Illustrator CS6\Presets\Scripts

You can see I’m using CS6 here, but I’ve tested it in CS5, CC, and CC2014. Plus, I have it on good authority that it works in CS4, too.

Now, once you’ve restarted Illustrator you’ll find the script listed under File > Scripts.

So now we’ll need to prepare our data source, which is our csv file, in order to have some variables to import.

Set Up Your Data Source Csv.

03-csv-setup

We’ll revisit the “Super Cards” I did in my last tutorial so we can examine the new process with them.

Checking the screenshot of my csv file you can see it looks pretty average. There’s no special tricks needed, and you can use any software that can generate a csv file. I usually use NeoOffice, a more Mac-like version of the OpenOffice software.

A couple of quick observations about the file

So basically there’s really not much to do here but fill/paste in your information, or clean up the column headers if the csv is provided to you by someone else.

Then it’s time to get into our Illustrator file.

Set up your Illustrator file.

04-illustrator-setup

Checking the above screenshot you can see my Super Cards file is back in action.

Everything that I want to be a variable is it’s own separate object. Some things to note here are:

You probably already have your desired file set up, but just make sure to give it the old once-over before you begin.

Run The Variable Importer Script

Ok, time to make the magic happen.

First, go to File > Scripts > VariableImporter then choose your csv file in the window that appears. Once you choose your csv file, you’ll see the below window:

06-variable-script-options-setup

This is the Import Options window, and you’ll see you have quite a few options here (see screenshot).

So once you’ve adjusted all these options to your liking, you just click the “OK” button at the bottom and the import will proceed. If all went well, you’ll get a dialogue pop-up declaring how many records and variable names have been imported.

08-successful-import

Check your Records

09-illustrator-change-data-set

After this, it will probably look like nothing has changed. This is because Illustrator doesn’t actually select the first record for you, so you have to choose your first record from the Data set dropdown in the Variables palette. Once you choose that first one, the correct information should now be showing in your file. Then you can use the arrows at the top of the Variables palette to quickly cycle through all your sets and make sure they are ok.

At this point all you have to do is export each Data set as it’s own file.

Export all Datasets via action

Now that you have the variables loaded in and working, you’re going to have to output these to separate files at some point. This is accomplished by using an export action. Basically you have to save the file first, record the saving of that file, then play it back so Illustrator can save all the files itself without user input.

If it’s not already open, select “Window > Actions” from the top menu. Select “New Action…” from the right flyout menu, or click the New Action button on the bottom of the Actions palette.

In the window that appears, you can name the action something like “Save EPS” or Save AI” or anything that helps you remember what it does.

Once you click the “Record” button in that window, the action will begin recording. From this point, do a “Save As Copy…”, and then choose your desired format and location. Don’t worry about what you name the file at this point.

It’s important to use “Save As Copy…” because if you simply use “Save As…” then for some reason Illustrator will not save the file extension. This may be fine for some, but the Rips I work with won’t process an image without an extension, so I gotta have it.

Another important note about “Save As Copy…”. In my experience I found you should not change the name of the file when you save it. If you do, then the extension will again be lost, and you’ll have to add it back using Bridge or some other method.

When the file is saved, make sure to click the “Stop” button at the bottom of the Actions palette. You now have a complete action you can use to export all of the datasets. You can delete this file you saved, since you won’t need it anymore.

Use export action in Batch process to export all files.

From here we’ll use the “batch” feature to run the action we just made on every one of the datasets.

To start, open the flyout menu on the Actions palette and choose “Batch…” from all the way at the bottom.

In the window that pops up, make sure your action is chosen in the “Action” dropdown. Set the “Source” to “Data Sets”, and choose the folder you saved to in the “Destination” area .

10-illustrator-batch-action

On the right of the “Destination” area is where I usually set my File Name to use “Data Set name”. You don’t have to use that option, it’s just the one I prefer.

As soon as you click the OK button, Illustrator will begin switching through all the data sets and saving them out according to your action. Depending on the speed of your computer and the number of records this might take several minutes. It will definitely be faster than doing it by hand, though.

At this point you’re essentially finished, you have all your files exported and ready to go. Obviously you should take a quick look at all the files using bridge and make sure no errors jump out at you, but basically it should be all done.

If all you needed were separate files, then mission accomplished. But, if you need to get those files laid out on one big sheet for printing, then you’d have to place them all back into Illustrator and group them by hand. In an upcoming tutorial I’ll talk about placing multiple Data sets up on a page.

Congrats, we just imported variable data – the easy way!

LINK ROUNDUP

Here’s a few quick links for convenience:

THE WRAP UP

So that’s all for this tutorial. I hope this provides a much easier method for working variable data in Illustrator.

Stay tuned for another tutorial I’m working on detailing how to add multiple Data sets to a sheet in a semi-painless manner. (EDIT: You can see this tutorial here: http://hypertransitory.com/blog/2016/04/11/adobe_illustrator_variable_data_multiple_datasets/

For a final announcement, earlier I mentioned that version 8 of the Variable Importer is already out. Well, I’ve actually created a video course that walks through all the bells and whistles of using that new script for variable data, and it will be available on Lynda.com very soon IT’S HERE! So those of you interested in checking it out can get more info on the Adobe Illustrator Variable Data Lynda.com course at that link.

With that said, I’m outta here. Leave me a comment or otherwise contact me if you have any questions or issues.

Previous » Next »

51 thoughts on “Adobe Illustrator Variable Data – The EASY way!

  1. This is beautiful ! Much easier than the other method that involved having to mess with the xml code. Great job on the written and video tutorials, and thank you Vasily for the script !

    1. Thanks, João!

      I think Vasily has started a revolution when it comes to handling variable data in Illustrator lol.

      All the best, man!

  2. Thank you so much for the detailed tut! One issue I ran into… I want to use Create Outline on the text data, so I included that in my Action. When that gets run in batch, it creates an outline for the first dataset record, but fails to go any further (the act of Create Outline rasterized the dynamic text, thus breaking the data mapping).

    Have you found a workaround?

    1. Actually, thinking about it a few more minutes, I reckon I can just create a new action to create the outline and batch the files a second time – 1st for the data, 2nd for the outlines.

    2. Hey Carrie, glad you figured something out!

      I was going to suggest doing something like duplicating the textblock(s)/layer(s) in the action, then outline, then export, but now that I think about it that would likely result in a bunch of extra layers in each file that exported. Plus hiding and deleting layers can get tricky in actions.

      Your way is probably the most foolproof to just run that extra action. All the best!

      1. Thanks for your response! Curious – are you still planning the follow-up tut for adding multiple datasets to a sheet? Or for that matter, just adding multiple files to a sheet to prep for printing. I’ve used Illustrator for years, but only in the most basic of ways.

        Thanks,
        Carrie

    3. Hey Carrie,
      I want to do the same, however i’m still confused as to how you made it work out? How do i make it so that I change the variable first then after expand/outline the textvariable and export?

      what keeps happening for me is that I do the first step by changing the variable, but it also saves and exports into separate files so i’d have to go back into every single file and outline it…

      1. Hi Rose,

        It looks like Carrie just ran all the exported files through another action to outline the text. So to quote Vasily’s comment from below:

        “The easiest way to get processed outlined text is to do a “double-trip” and run a batch-action again through your result files with an action that converts text to outlines.
        So your step 1 is to export all the documents to get the different doc contents and step 2 is to process the resulting documents from step 1.”

        If you wanted to do it all in one shot I think it would have to go something like this:

        1. Select all text variables (perhaps with Select > Object > Text Objects)
        2. Copy (now all text is on the clipboard)
        3. Hide (original variables are now hidden)
        4. Paste (duplicates are now on the artboard and are selected)
        5. Outline
        6. Save as copy
        7. Delete (outlined text is now gone)
        8. Unhide (original variable text is now visible again)

        Then hopefully it would just continue on to the next dataset. I haven’t tried this out yet, but some permutation of this might work.

  3. Hi,

    Thanks heaps, this was a great tutorial.
    I eagerly await the next on “RenameArtFromText.jsx”.

    In return, I have a super cool tip on creating interactive illustrator documents. To use as a prototyping tool.
    You may wish to share it with your audience.

  4. Hi,

    Thanks a lot for your sharing! What a great and detail tutorial.
    I also did try the ” easier ” way, but it seems there is bugs of the online .xml convertor, that I always have problems in loading the data in ai (invailds happens all the time when there are more there 30 variable datas)
    But it works just perfect with the importer scripts.

    I have another question to ask for help.
    As I will need to output files to printer, how can I export all the files with all data (fonts) outlined?

  5. Carmen : please see the solution by Carrie Dills.
    The easiest way to get processed outlined text is to do a “double-trip” and run a batch-action again through your result files with an action that converts text to outlines.
    So your step 1 is to export all the documents to get the different doc contents and step 2 is to process the resulting documents from step 1.

  6. Thanks so much!
    Great script and very helpful tutorial.
    I am very interested in that other tutorial you mention in the end of your video (how to use multiple datasets on a single page – important for the printing of these individual cards).
    Looking forward for it :)

    I didn’t find a way for that on the internet. The only hint was here:
    https://forums.adobe.com/thread/893332?start=0&tstart=0
    It seems someone there posted a url to a video showing hot it works, but it doesn’t load…

    1. Awesome tut! Saves hours of frustration.

      I’m with @Herman. Any hints for laying all out on a single page so we can send to print?

      Thank you!
      Pavel

  7. Did you ever get around to making a tutorial on multiple datasets on a single page? I’ve got a massive project I’m working on and I’d love to not have to save & open 27,000 files.

  8. when I try to save the .jsx to my computer it only allows me to save it as a .txt format, how do I get he.jsx? any tips? I’m on a mac.

  9. Is there any limit to how many variables the script can process? I get errors when I try to upload my csv with 1275 variables, but no issue with 999 variables. I’ve also uploaded variables 999-1275 successfully, so I know there isn’t a problem with the column names.

    1. Hmmm…I’m going to contact the developer and see if he knows anything about this. Hopefully it’s not a hard limit and can be easily overcome.

  10. Hi guy’s and girls,

    I need some help, if tryed every thing. i did all what you did the same. and still i can’t find the files.
    and i need this project done by tomorrow. i need around 300 files. and it’s not working for me.
    i have 2 pictures and 4 text items.

    thanks anyway

    1. Hi Jsandee,

      can you contact me via my contact form and give me the details via email? I’ll try to help you out.

      If it turns out to be any kind of bug or something I’ll update the post and comment back so everyone can see.

  11. Hi guys,

    Does anyone know any good ways to get symbols into the text?

    Say I have a card game and want to show a symbol of attack whenever I reference it in the text.

    “Whenever the Spagetti Monster does damage (attack symbol), the victim becomes *wet*.”

    1. Hi Sig,

      as far as I know, Illustrator doesn’t support “inline graphics” like that. It seems like it should, but it doesn’t.

      So you’d have to place that in manually after import.

      If this is a deal-breaker, you might be able to pull it off with InDesign’s Data Merge feature.

      With InDesign, you can place multiple variables *within* a text object, instead of Illustrator’s way of using the entire object itself as a variable.

      So you would have “Whenever the Spagetti Monster does damage [[image]], the victim becomes *wet*.”

      Since InDesign supports inline graphics, it would just plunk the symbol right in there.

      I know most people don’t want to port over their project from Illustrator to InDesign, so it all depends on how much work it is to do it manually. If you’ve got a couple of hundred of these to do, it might be worth it to go back and set it all up in InDesign.

  12. HI,

    I used the script for some time, great work.
    But since yesterday I get a error message
    error 21 undefined is not an object
    line 2684
    this.window.uielements ….. .active = false;

  13. Hi Tim,

    Which version of the script are you using? And which version/platform of Illustrator?

    If you’re still using version 7, try upgrading to version 8 to see if that helps.

    Also, I think I’ve seen that error before when there was a space or another character in the csv somewhere there shouldn’t be any data. Try copying and pasting just the data (don’t select the whole spreadsheet, only the cells that have data) into a new spreadsheet file, then see if that fixes it.

    If it doesn’t, then use my contact form to reach me via email, then maybe I can see your files to try to repeat the issue.

  14. Hello,

    This script and batch saving worked great for me for about a month…and now it doesn’t change the name / number before saving so I end up with 6 of the same thing. It knows that there are 6 “different” names / numbers so it saves it 6 times, but doesn’t change anything before saving. Again, it worked for a month and then just stopped working. I’m on Adobe CC with version 8.1.0 for the VeriableImport.jsx Any help would be very appreciated.

    Jordan

    1. Hey Jordan,

      when you run the tests in the Variable Importer does it give you any errors at all?

      Have you tried changing the File Name saving options in the Batch window at all?

      If that doesn’t help please use my contact form to contact me (easier for me to keep track of), then if possible you can send me the files and I’ll take a look.

    2. Ok…for anyone reading this: Me and Jordan conversed and tested via email, and it looks like the cause of the problem there was he was trying to bind to the LAYERS, and not to the OBJECTS, which are contained in the Layers.

      So if it seems like things aren’t binding correctly or the objects are not being found, make sure to check that you didn’t name the Layer by mistake – especially those of you who use sublayers.

  15. Hi JG,

    I have the same problem as Tim, I am using the latest version of the script (by the way amazing work), suddenly today I couldn’t use it anymore.
    The message that appears is:

    “error 21 undefined is not an object
    line 2684
    this.window.UIElements[“list_warnings”].active = false;

    I tried restarting Illustrator and with a new different document, but it seems it fails as soon as I run the script.

    Hopefully there is something I can do.

    Thanks

    1. Hey Diego, wish I could take credit for this awesome script, but alas, it was Vasily, and not me who made it :) -I’ll pass along the compliment, though!

      As for the error, are you using Mac or Windows? And what version of Illustrator. I was running tests on my Mac but I could never repeat the error myself. Also, does version 7 work for you? Or are they both hosed?

      I forwarded Tim’s error to Vasily and he’s already working on it. Hopefully, he is able to get a handle on it. This seems kind of an out of the blue error that doesn’t happen often so it’s hard to diagnose without much to go on.

      I’ll post back here when I have updates.

  16. Hi JG,

    First of all great script and very helpful tutorial.

    Is there any limit to how many variables the script can process?

    It’s impossible load my csv with 18 variables, but no issue with 12 variables.

    Any idea?

    Thanks in advance.

    Regards

    1. Hi Jonay,

      is it possible for you to send me your files so I could take a look myself?

      As it happens, I’m working on a method of reducing the amount of work the script has to do, and maybe it could help out here. I’ll be coming out with a new video soon, but for now please contact me through my contact form and then hopefully we can work out how to get the files to me (assuming you’re allowed to do so).

    2. For anyone reading this, Jonay’s situation was not actually caused by having too many variables, but instead there was data of some form outside of the columns of his Excel file.

      For example, he had 18 columns, so columns A-R had headers and data in them. The problem arose because there was data in column “S”, which had no header.

      I couldn’t tell what it was, so it may have been a non-printing character or even a space, but the Variable Importer was failing because it couldn’t resolve the issue in this case.

      Jonay solved it by simply adding a header to column “S”, and then everything behaved normally. I was able to solve it by clearing the contents of column S, and also by just outright deleting column S.

      In a case where you don’t know where the extra character is (if it’s way out in cell AZ1 or something), you would just copy only the specific cells of your data, then paste it into a new document. That way you can be sure only the data you want is in there.

  17. Hi John,

    Thank you for sharing this script. I have tried everything but cannot get it to work. I have Illustrator CS4 and every time I try to use the script I get this message: Script Alert “Sorry, the file ‘” + decodeURI(xmlDest) + “‘ could not be saved.” What am I doing wrong?

    Thanks,
    Lizzie

    1. Hi Lizzie. are you sure you downloaded the file the right way? When you get over to GitHub you have to make sure to click the “Raw” button, then save the raw code that’s dumped into your browser window, making sure to save it with the “.jsx” extension.

      If you’re on the Mac, sometimes the Finder tries to help you by adding “.txt” to the end of the file, and then hiding it. If you do a ‘Get Info’ on the script file then you would see the hidden extension there, and you can remove it.

      I suspect one of these things is happening. Let me know if any of this helps.

      1. Thanks so much for getting back to me. Yes, I saved it the raw way and by copying and pasting into notepad with the .jsx extension. It never worked. But the problem could be that my Illustrator .exe file is not saved in the default location so maybe the program could not find the right file paths (?). I also have Illustrator CS6 on another computer. So I used the same script files with CS6 and it works like a dream. Thank you so much for sharing this script and the tutorial. It literally is life-changing for my workload!

        Best,
        Lizzie

Comments are closed.