Copy link to clipboard
Copied
Hello all, I need some help...
I am building a series of logos — based on word strings — using Illustrator CS4 with a combination of Actions, but also retrieving the word string from an Excel file.
Normally for one or two iterations of the process, I would not hassle with a script, but this is a mind-numbing repetitive task, and I have to make 6,000 logos!! Seems the ideal use for a script.
We have tried to work with ExtendScript Toolkit (ESTK) but we can't get our heads around how to make it do certain things, and I can't find anyone who really knows how to use ESTK correctly.
I have a MAC, so the script has to be written in Java Script or Apple Script.
Here's what I need to do:
This is a tricky one, but there's got to be a way to automate the process... otherwise I'll go crazy doing this manually!!
IS THERE ANYBODY OUT THERE WHO CAN HELP?
Thanking you in advance for any assistance.
All the best.
Just a muppet 4 now… but one day maybe a star…
Hope it works as you wished…
Copy link to clipboard
Copied
It sounds like what you're trying to do might be appropriate for Illustrator's Variables feature. You can pre-stylize textFrame objects, "bind" those objects as variable text objects, and then replace their contents with DataSets (records). The iterations can then be automatically swapped-out and saved by running an ordinary Action in batch mode. The feature is dependent upon a cumbersome implementation of XML. For my own purposes, I hacked out a Javascript that creates DataSets from ordinary tab-delimited text.
See the description and PDF example of JET_VariablesFTROU.
Depending on how graphically-elaborate the styling of the variable elements, you may also find this much more direct by using InDesign's data merge feature.
As for the re-formatting of the text strings, I'm wondering why you would want to do all that in Illustrator. Why not use the intelligence already built into a spreadsheet or database or even word-processor to do the necessary find/replace operations to insert spaces, special characters, etc.? (The values you're describing look like values that would have been auto-concatenated from separate field values to begin with.)
Ideas for AI scripts often seem to want to reinvent the wheel.
You also seem to be confusing Illustrator Actions with its scripting. Actions and scripts are two different things, and in Illustrator, they don't talk to each other very well.
JET
Copy link to clipboard
Copied
Thanks for that JET...so far.
No I'm not confusing the two. I'm aware of each one's strengths and weaknesses, and not into reinventing any wheels.
My very limited understanding of ESTK is that it is a scripting tool for use in Illustrator. This is why I was suggesting it as a solution.
My objective is simple... turn 6,000 word strings into Stylized logos, save them in AI for future use and also generate a PNG for web use.
One thing I didn't mention, because I didn't think it was relevant in this contect:
But I am also not a coder, so much of what you've said — whilst appreciated — has gone over my head. My talents lie elsewhere, unfortunately, in this case. So, in my over simplified world, I'm pretty much indifferent as to how it gets done, as long as it gets done.
I haven't figured out how to tell an action to "select" caps or last two letters, how to go get a file name, and except in Batch mode, how to save to a specific folder.
Moreover, Excel does not have the typography control I require....letter spacing, baseline offset, stroke and fill, etc.
And, no special characters, because the font I'm using doesn't have the â„¢ symbol, hence I have to manufacture it from scratch.
I had thought about Batching, and this is what I was trying to incorporate...but again, my knowledge is somewhat limited.
Anyway, you want a paying gig? Make it happen for me and I will be most grateful.
Steve
Copy link to clipboard
Copied
IS THERE ANYBODY OUT THERE WHO CAN HELP?
Depends on what you mean by "help." Are you asking someone to do the whole thing for you (would require more detail), or do you intend to do it yourself, but are stuck on something? (You say you "tried to work with ESTK" and "can't find anyone who really knows how to use ESTK correctly"; but you don't say specifically what you're struggling with in ESTK.)
...doc is already configured with art board, pre-defined type box (Area Type Optioned), Charater Styles, Drop Shadow parameters set.
Much of what can be done with any approach depends largely upon what Appearances and/or Effects are involved, and where. You imply that you want all of the "logo" to be contained in a single textFrame object. But Drop Shadow Effect cannot be applied at the character level, so it can't be included in a Character Style.
So if you don't want all the text to have the same drop shadow, you will be involving multiple textFrame objects. That will lead to the complication of having to position the two textFrames relative to each other, depending on their dimensions after the varying text is inserted.
Retrieve the word string from a cell in Excel worksheet (or CSV??)
With scripting, it would be inefficient and unnecssary to go back-and-forth to the spreadsheet to extract values one at a time. Typically, you would create an array containing the full set of values, and then iterate through the elements of the array.
Some are single words, first letter capped. Some are two to four words Camel Cased. Example: "DinnerPartiestm".
So you're going to need a sub-routine of some kind (in Javascript, a function) to find capital letters.
There are two additional charaters "tm" at the end of the word string that will be acted upon...
If this is the same in each instance, and if you are going to script this, there is no need to include it in the data. Insert the "tm" programmatically.
That is, in Illustrator, "select" the type box so the cursor is at first position and place the word string — copy from Excel & paste into Illustrator?
Using script, you don't have to select the textFrame, copy, or paste in order to insert content. You would declare a variable, assign its value (from the above-mentioned array), add the variable's value as text to textFrame's content.
Apply character style 1— font with point size, letter spacing, stroke and colour (It just happens to be red). Example: DinnerPartiestm
Here you will run into a difficulty inherent in Illustrator's poor implementation of stroked text. You can apply a Stroke at the Character level and include that Appearance in a Character Style. But Illustrator always positions such strokes in front of the fill--something you almost never want, because it "chokes" the fills, wrecking the shape of the characters. The workaround is to Add New Stroke and position that below the Characters listing in the Appearance Palette. But script provides no access to added strokes or fills and Added Strokes cannot be applied at the character level.
Select all caps in word string. Example: DinnerPartiestm
Illustrator cannot select discontiguous text strings. Again, script does not have to select objects in order to change their properties.
Apply character style 2 — Caps Only (selected) — New point size, baseline offset. Example: DinnerPartiestm
Apply character style 3 — last two letters only (selected) — New point size, change colour, baseline offset. Example: DinnerPartiestm
The applyTo method of the CharacterStyle object. Or, just set the size and baselineShift properties of the characterAttributes property of the textRange directly.
Apply Stylize > Drop Shadow — On contents of text box
Drop Shadow Effect cannot be applied to the contents (character level) of a textFrame--only to the textFrame object itself.
My very limited understanding of ESTK is that it is a scripting tool for use in Illustrator.
It's a script text editor included with the Creative Suite. You can use it to build scripts for any of the CS products (or entirely other purposes, for that matter). Or, you can choose to not use it at all. A Javascript is just a text file. Tools like ESTK add conveniences, references, etc., geared toward scripting.
So, I'm only acting on the word string....
But I am also not a coder...
Which is why I would look into simpler already-built methods before jumping into a tedious solution scripted for Illustrator. For example: Many, if not most, AI users are familiar with InDesign. InDesign provides a proper dataMerge feature that can handle ordinary tab-delimited text. It's handling of strokes on text is correct, unlike Illustrator. If you set it up accordingly, it can create all the separate pages for you.
You would:
1. Draw the fixed graphic in Illustrator.
2. Place the Illustrator graphic on InD's master page.
3. Set and style the text objects. Insert DataMerge tags.
4. Import the data and run the Merge function.
InD builds individual pages for each row of the data. You're done. Export to PDF. InD and Acrobat also have their own scripting models. Either one can handle the specific naming convention, if really needed.
Again, it depends on what exactly is "special" about the text object(s) you are manipulating with variable content. For example, if you're using an AI-specific Warp effect, you'd be back to Illustrator.
Anyway, you want a paying gig?
I do some freelance work as time permits and interest strikes, but I'm not cheap, and that's not why I frequent these forums.
Scripting your solution entirely in AI may very well be possible, but whoever does it will need to see the specific objects, styles, etc., involved to avoid unnecessary guessing and time-consuming round-tripping. Why don't you post an image and/or an AI file?
JET
Copy link to clipboard
Copied
Hi thamarc,
Have you two different (one with low length word, another one with high length) sample pictures of yours final AI ? Because i would like know why you make a pause on differents moment of script..
Cyao, art.chrome
Copy link to clipboard
Copied
I took a look at what you were trying to do here. You do not copy n paste with script (where possible) you read n write. You don't need any actions nor do you need to do any object selection. I have put together what should be close to your request with a little guesswork. What this ESTK script sample is expecting is an open active document containing 3 character styles and 1 graphic style and a single text box. I do not have the time to build in a whole host of error trapping. You will need to save your Excel workbook as CSV file. NameStings in column A, FileNames in B. I have commented the script where you may need/want to make edits to suit. Only tested with a few dozen 6000 may take some time so run a few tests first.
#target illustrator
function processCSV() {
// Edit the name strings below to suit your doc
var csvFile = new File('~/Desktop/NameStrings.csv');
if (csvFile.exists) var fileArray = readInCSV(csvFile);
//alert('CSV file has ' + fileArray[0].length + ' columns…');
//alert('CSV file has ' + fileArray.length + ' rows…');
var defaultFolder = new Folder ('~/Desktop');
var aiFolder = defaultFolder.selectDlg('Please Make/Select a Folder to save ".ai" files to…');
if (aiFolder == null) return;
var pngFolder = defaultFolder.selectDlg('Please Make/Select a Folder to save ".png" files to…');
if (pngFolder == null) return;
docRef = app.activeDocument;
var aiOptions = new IllustratorSaveOptions();
with (aiOptions) {
compatibility = Compatibility.ILLUSTRATOR12;
compressed = true;
embedICCProfile = true;
embedLinkedFiles = true;
flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;
fontSubsetThreshold = 0;
overprint = PDFOverprint.PRESERVEPDFOVERPRINT;
pdfCompatible = true
}
var png24Options = new ExportOptionsPNG24();
with (png24Options) {
matte = false;
transparency = true;
antiAliasing = true;
artBoardClipping = true;
horizontalScale = 100;
saveAsHTML = false;
verticalScale = 100;
}
with (docRef) {
// Edit the name strings below to suit your doc
var capStyle = characterStyles.getByName('Cap'); // Here…
var lowerStyle = characterStyles.getByName('Lower'); // Here…
var tmStyle = characterStyles.getByName('TradeMark'); // Here…
var dropShadow = graphicStyles.getByName('Drop Shadow'); // Here…
for (var i = 0; i < fileArray.length; i++) {
var textString = fileArray[0];
var fileName = fileArray[1];
textFrames[0].contents = textString;
for (var j = 0; j < textFrames[0].characters.length-2; j++) {
var thisChar = textFrames[0].characters
If you are stuck with the tweaking post back. No promises though.
Copy link to clipboard
Copied
Guys... How do I attach an AI doc to this post? And is there PM facility on this forum? Can't find either.
I've got a sample prepared that you can play with.
JET: Character Styles already prepared, as I said. Appearance Panel already set.
You sure can apply a global drop shadow to contents of Area Type Optioned box...'cuz I've done it.
Not gonna use ID because I want to retain a copy in AI...for collateral materials. Also avoiding colour shifts between programs.
Muppet: WOW! Thanks for the effort. Unfortunately, I'm not a coder so couldn't tweak it if my life depended on it.
Yes, have word string and file name in two columns in excel.
Steve (my real name)
Copy link to clipboard
Copied
PM in these forums is at the top of the page along side your account login welcome…
If you do post a sample file could you do on as CS2 too… just so I can take a look. (stuck with dated software).
Copy link to clipboard
Copied
OK, found the PM...thanks....
Still don't see how to attach a doc.
I've got no probs down saving to CS2, but not sure ESTK CS2 is same as for CS4?
Ooooops... there are 2 artboards in my doc. Does CS2 support multiple Artboards? LOL, I upgraded from CS 1, so what did I know about multiple artboards?
You can always download a 30-day trial of AI CS4... and I can send you ESTK for CS4...or you can download it.
anyway... where's the "attach" doc?
Copy link to clipboard
Copied
You sure can apply a global drop shadow to contents of Area Type Optioned box
No, you cannot. The content of a textFrame is a textRange (characters). You cannot apply Drop Shadow Effect at the character level; only at the level of the whole text object (the textFrame). In other words, as already explained, you cannot have both the company name and the "tm" in the same textFrame and have a live Drop Shadow applied to the company name, but not to the "tm". Your Character Style cannot contain a Drop Shadow. A Graphic Style can, but a Graphic Sytle also cannot be applied at the character level.
JET
Copy link to clipboard
Copied
Hmmmmm
I've done the DS to my complete satisfaction.
Did I say I wanted to selectively apply DS to only certain characters? Nope. To all characters in the text box (frame).
Did I say that DS was part of a Character Style? Nope. Appearance Panel....Although it would be cool if I could include it in a Character Style, so I could save two steps. But, ya can't. That's why DS is given as separate actions (please see items 9 & 10 in my original post).
Folks, I've already run through all of the manual steps necessary to achieve the desired results. Now, the challenge is to set things up, push the "go" button, so I can have a coffee and a cig, maybe go for a walk with my dogs....whilst my MAC chugs through 6,000 tedious iterations of mind-numbing work.
Thanks for your comments, though....much appreciated.
Steve
ps... Anybody? Where/how do I attach the AI doc? I don't live on this forum.
Copy link to clipboard
Copied
Unfortunately you can't attach documents -- there's some sort of security issue that has caused the forum administrators to disable that feature. So you'll need to post it on some external web site and post a link here.
Copy link to clipboard
Copied
Hey John:
Can't attach docs? Well, that's a bummer.
I'll look into setting up a site so you guys can download the docs, but that's tedious.
Here's an image I've created to walk you through the steps. It's a set of instructions, not what the master doc would look like. Moreover, this is how I do it manually, only in AI. The script would have to handle all non-actionable functions, like getting the word string, selecting specific characters, getting the file names, selecting the folders into which the files are saved. This is as KISS as I can make it.

In the meantime, if anyone is interested PM me and I'll send working docs by email: functioning AI doc with presets and styles, sample excel sheet.
To JET and Muppet and all:
I am NOT a coder. I am NOT a techie. My strength lies in wrangling a brand under a marketing umbrella, and I need a ton of logos created. I've always believed in using experts for expert stuff. So if anyone is interested in helping me do this, let me know....
Thanking you all in advance,
Steve
Copy link to clipboard
Copied
In the line near the top…
var csvFile = new File('~/Desktop/NameStrings.csv');
just change the italics part to the name of your CSV file… Presuming its on your desktop.
and further down… the 4 lines require the names of the styles that you've used. 3 character styles 1 graphic style.
var capStyle = characterStyles.getByName('Cap'); // Here…
var lowerStyle = characterStyles.getByName('Lower'); // Here…
var tmStyle = characterStyles.getByName('TradeMark'); // Here…
var dropShadow = graphicStyles.getByName('Drop Shadow'); // Here…
These lines will fail if not present in the open document. Just double click and cut & paste from your document into the ESTK.
If this works with a doc containing just a text box then altering the code to deal with the real world art should not pose too much of a problem. Getting your doc available would be a huge help.
Copy link to clipboard
Copied
Hey Muppet....
Thanks man...
Let me sort out these files on Senduit... and then I'll post a link.
Steve
Copy link to clipboard
Copied
I had NOT noticed that the posting of files had been with drawn from these forums. Used to be at the base of the window when making a post. I've only just learnt how to post code 'styled' thanks to John. Thought they were marking it up themselves with beyond me.
All part of the learning process… Both me & Jet have had our accounts mangled by the forum pixies… Needs sorting out…
Copy link to clipboard
Copied
Yeah... I got that sorted....
Anyway, just gonna record a short movie to demo my process, then it'll all be up on Senduit.
Remember, I will down save the AI docs to CS2 for you...but I'll be using CS4 for MAC. The stuff I'm doing in AI is really primative, so I can't imagine there will be conflicts. But, the Java Script wants to be saved in .jsx
Steve
Copy link to clipboard
Copied
Did I say I wanted to selectively apply DS to only certain characters?
No, you didn't say either way. That's why I brought it up. Usually, registered, trademark, servicemark indicia are meant to be as unobtrusive as possible, so they aren't decorated. It was a perfectly sensible question. That's just one reason why anyone trying to offer suggestions needs to know (and/or see) what the actual graphic requirements are in order to avoid just spinning their wheels. If you were treating the trademark in the usual and customary way, you'd need a separate textFrame object.
Did I say that DS was part of a Character Style? Nope.
Did you say specifically how you intend to achieve the required results in code? No you didn't. But the drop shadow has to be referenced somehow in code, if it's going to be applied by code. Your initial post runs through a long list of what you think the script needs to do, just because that's what you do manually in the UI. In fact, (now that you've clarified the question of whether the trademark indicia receives it) the script doesn't need to apply the Drop Shadow at all; it should already be applied to the placeholder textFrame object in the template. (The same would be true of the Character Styles, but for the fact that you don't know how many words are included in each intercap.)
Folks, I've already run through all of the manual steps necessary to achieve the desired results...Now, the challenge is to set things up, push the "go" button....
Understood. There's nothing special about this from the UI perspective. But you are under the assumption that anything and everything that can be done in the UI is directly supported one-to-one in script, and that Scripts can reliably launch Actions, wait for them to run, and vice-versa, and then resume. Those are common misconceptions, but it doesn't work that way. Using the scripting model is not just a process of "calling" UI commands in sequence.
For example, nothing in this thread so far addresses the problem of Illustrator's stroke on text (the stroke that can be included in a Character Style in AI) being applied on top of the fill. Maybe you don't see an issue with a 2 pt. black stroke choking letter glyphs. Most serious logo designers would.
I'm certainly not saying this can't be done in script. I read your initial post as a request for help in doing this, not for someone else to just do it for you. I've been trying to let you know some of the caveats you'll need to consider, that it's not a simple scripting task for someone new to scripting, that there are probably other ways to accomplish such a thing in the normal UI (depending on the tools at your disposal)--and that if someone is going to do it for you, they need to see a specific example, so as to know the answers to the questions I raised and avoid spinning their wheels.
JET
Copy link to clipboard
Copied
Hey JET. Thanks for that.
I think I've approached this with an open mind regarding perhaps asking for something that just can't be done.
If it can be done, then really cool.
If only part of it can be done, and there has to be some manual intervention on my part, then kinda cool. Better than nothing.
If it can't be done, then I'm a big boy. And, I know what I'm gonna be doing for the next month... but repetitive tasks create fatigue and invite errors. Hence my desire to remove slippery fingers and mistyping...or copying and pasting the wrong cell content because I'm burned out by sitting in front of my computer for 18 hours. Even if I could manually do one iteration a minute, that's still 100 hours solid. Ya know?
Had all the other stuff you mention (stroke, choke) been an issue I would have mentioned it. I've been in print for 20 years, so I dig what you're saying about choke (and spread and overprint and knockout, etc.) Fortunately, that's not the case here.
Because I knew from the get-go that I had to crank out thousands of these things, I designed the logo to be simple to replicate, built by KISS, and specifically for mass production. And I also built it with the notion that once saved to .png, as a flat image, the issues you mention — if present — become moot.
Anyway, bear with me....I'm gonna pop off the forum and record the movie....
Copy link to clipboard
Copied
OK, folks... for you...
http://senduit.com/b72635 ....it's up for 24 hours.
Sorry it took so long. First the boat race, then Dr. Who, then some exigent relaxation.
This should help you out:
I added a DS graphic style to the text box, so that cut out a step. Found a shortcut or two, too.
The only Panel you'll need up as you work through this is Character Styles. Everything else preset.
Qualms or queries? Let me know.
Steve
Copy link to clipboard
Copied
I using file 'Logo Master for AI Forum-CS2.ai' running script 'CSVtoText.jsx' I was able to output files AI & PGN at about a second at piece.
Made a small edit to 'Logo Master for AI Forum-CS2.ai' there was another text box in layer 'Generic Logo'
Could not open your 'Sample Wordstrings Logo.xlsx' so I have included a sample of what the script would be expecting.
http://senduit.com/58d710
Copy link to clipboard
Copied
Hey M:
The drop shadow is missing in both the .ai and .png.
Were you able to watch the movie? You'll note that I added DS to the text box as a Graphic style (Appearance).
There is, however a "Text Shadow" effect in the Appearance Panel in the file you sent me, which, unfortunately, isn't working.
This might be a problem of the CS4 to CS2 down save.
Now, I don't really know what I'm doing, but looking at the script in BBEdit I see:
Line 26: compatibility = Compatibility.ILLUSTRATOR12; May I change this to ILLUSTRATOR14; ? This is my version.
Line 51: var dropShadow = graphicStyles.getByName('Shadow'); In my version it's not called "Shadow", but maybe I'm just dumb and it doesn't matter.
How do I designate which columns to "get" from in the Excel file. I do see there is an opportunity to select the .CSV file.
BTW, I'm using Excel for MAC Office 2008 (.xlsx). Are you Mac or PC? And which version of Office are you running? I'll send you the correct version in standard .xls and .csv as soon as you tell me which version.
Be this as it may... can you walk me through what I have to do to set up the Java Script? Like where do I put it? And how do I activate it? Then I can test it on my version, and if it's done it's done!!
So, with your guidance I will set this up. If you want to PM me with your tel Nº or Skype name, I'll bell you.
And, man, thanks....it seems we're only a few paces away from success.....
Steve
Copy link to clipboard
Copied
Hey MM:
I just ran a test by down saving again to CS2. I did get a warning that:
"Saving to a legacy format may cause some changes to your text layout and disable some editing features when the document is read back in. Also, any hidden Appearance attributes will be discarded when read back."
This could apply to the DS I added to the text box, becuase, unless the text box is selected, the appearance panel does not show the DS attribute.
And in my docs, there is no extra text sublayer in the Generic Logo layer.
I guess we just run the script and see what happens in CS4 (AI 14.0) native.
Steve
Copy link to clipboard
Copied
Steve, in the file was a graphic style called shadow. Which the script applied to the text box. Overwriting what was already applied. You should be able to find the ESTK app in your utilities folder in Adobe Utilities folder. If you open the script in this then you can make and save a few edits. You can run the script from here or place in Illustrators scripts folder.
You are correct that you can change the 12 to 14 for your version.
In addition to this to fix the incorrectly apply shadow i have commented out 2 lines.
#target illustrator
function processCSV() {
var orginalUIL = app.userInteractionLevel;
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
if (app.documents.length == 0) {
alert('Please have an "Illustrator" document open before running this script.');
return;
} else {
docRef = app.activeDocument;
}
var csvFile = File.openDialog('Please select your CSV File…', isCSV);
if (csvFile.exists) var fileArray = readInCSV(csvFile);
alert('CSV file has ' + fileArray[0].length + ' columns…');
alert('CSV file has ' + fileArray.length + ' rows…');
var defaultFolder = new Folder ('~/Desktop');
var aiFolder = defaultFolder.selectDlg('Please Make/Select a Folder to save ".ai" files to…');
if (aiFolder == null) return;
var pngFolder = defaultFolder.selectDlg('Please Make/Select a Folder to save ".png" files to…');
if (pngFolder == null) return;
var aiOptions = new IllustratorSaveOptions();
with (aiOptions) {
compatibility = Compatibility.ILLUSTRATOR14;
compressed = true;
embedICCProfile = true;
embedLinkedFiles = true;
flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;
fontSubsetThreshold = 0;
overprint = PDFOverprint.PRESERVEPDFOVERPRINT;
pdfCompatible = true
}
var png24Options = new ExportOptionsPNG24();
with (png24Options) {
matte = false;
transparency = true;
antiAliasing = true;
artBoardClipping = true;
horizontalScale = 100;
saveAsHTML = false;
verticalScale = 100;
}
with (docRef) {
var capStyle = characterStyles.getByName('Style 2: Set Caps');
var lowerStyle = characterStyles.getByName('Style 1: Set ALL Type');
var tmStyle = characterStyles.getByName('Style 3: Set tm');
//var dropShadow = graphicStyles.getByName('Shadow');
var genericLogo = layers.getByName('Generic Logo');
var genericText = genericLogo.textFrames[0];
for (var i = 0; i < fileArray.length; i++) {
var textString = fileArray[0];
var fileName = fileArray[1];
genericText.contents = textString;
for (var j = 0; j < genericText.characters.length-2; j++) {
var thisChar = genericText.characters
You will see from the sample excel files the script is looking for your nameString to be in the first column and the 'files' nameString to be in the second column then save out to CSV.
Copy link to clipboard
Copied
OK... let me give it a whirl and see what happens.....
Find more inspiration, events, and resources on the new Adobe Community
Explore Now