Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scripting Illustrator actions, incorporating calls to Excel

New Here ,
Apr 02, 2010 Apr 02, 2010

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:

  1. Execute Action: Open a Master Illustrator doc. This doc is already configured with art board, pre-defined type box (Area Type Optioned), Charater Styles, Drop Shadow parameters set. <pause Action>
  2. Run Script: Retrieve the word string from a cell in Excel worksheet (or CSV??). Some are single words, first letter capped. Some are two to four words Camel Cased. Example: "DinnerPartiestm". There are two additional charaters "tm" at the end of the word string that will be acted upon (remember these two characters for item 7 below)
  3. Run Script: Place this WordString into the predefined type box in the Illustrator Master doc. 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? <pause Script>
  4. Execute Action: Apply character style 1— font with point size, letter spacing, stroke and colour (It just happens to be red). Example: DinnerPartiestm  <pause Action>
  5. Run Script: Select all caps in word string. Example: DinnerPartiestm <pause Script>
  6. Execute Action: Apply character style 2 — Caps Only (selected) — New point size, baseline offset. Example: DinnerPartiestm <pause Action>
  7. Run Script: Select last two letters of word string. Example: DinnerPartiestm <pause Script>
  8. Execute Action: Apply character style 3 — last two letters only (selected) — New point size, change colour, baseline offset. Example: DinnerPartiestm <pause Action>
  9. Run Script: Select text box. <pause Script>
  10. Execute Action: Apply Stylize > Drop Shadow — On contents of text box, preset DS parameters in either Appearence panel or Effect menu.
  11. Execute Action: File > Save As .ai document. <at Save As dialog, pause action>
  12. Run Script: Retrieve file name from Excel and place in Save As dialog (copy & paste?). In next column in Excel doc, same row, is a SEO-friendly file name. Example: word string is "DinnerParties"; file name (next column) is "logo-dinner-parties"
  13. Run Script: Select folder to save the .ai doc into. Example: Folder is "Logos AI". <pause Script>
  14. Execute Action: Complete Save As. Example: in Folder "Logos AI" now we have the file "logo-dinner-parties.ai"
  15. Execute Action [assumes that the Saved As document — logo-dinner-parties.ai — is now the active one in Illustrator]: Save for Web & Devices. Preset to PNG24/Transparent. Correct file name will NOT be in Save field. <at Save dialog, pause action>
  16. Run Script: Repeat retrieval process to get same file name from Excel.
  17. Run Script: Select new folder to save the .png doc into. Example: Folder  is "Logos PNG". <pause Script>
  18. Execute Action: Complete Save for Web. Example: in Folder "Logos PNG" now  we have the file "logo-dinner-parties.png"
  19. Execute Action: Close
  20. Repeat steps 1 though 19 until all word strings processed: Script has to know to go to next word string (next row) in Excel doc.

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.

TOPICS
Scripting
18.7K
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

Guide , Apr 04, 2010 Apr 04, 2010

Just a muppet 4 now… but one day maybe a star…

Hope it works as you wished…

Translate
Adobe
LEGEND ,
Apr 02, 2010 Apr 02, 2010

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

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
New Here ,
Apr 02, 2010 Apr 02, 2010

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:

  • The finished logo is actually comprised of a graphic placed before the stylized word string.
  • This graphic is in place on the artboard, in a locked layer.
  • So, I'm only acting on the word string.

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

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 ,
Apr 02, 2010 Apr 02, 2010
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

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
Engaged ,
Apr 02, 2010 Apr 02, 2010

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

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
Guide ,
Apr 02, 2010 Apr 02, 2010

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.contents;                     if (thisChar == thisChar.toUpperCase()) {                          capStyle.applyTo(textFrames[0].characters, true);                     } else {                          lowerStyle.applyTo(textFrames[0].characters, true);                     }                }                tmStyle.applyTo(textFrames[0].characters[textFrames[0].characters.length-2], true);                tmStyle.applyTo(textFrames[0].characters[textFrames[0].characters.length-1], true);                dropShadow.applyTo(textFrames[0]);                //alert('Save This');                redraw();                                var saveFile = new File(decodeURI(aiFolder) + '/' + fileName + '.ai');                saveAs(saveFile, aiOptions);                                var saveFile = new File(decodeURI(pngFolder) + '/' + fileName + '.png');                exportFile(saveFile, ExportType.PNG24, png24Options);           }           close(SaveOptions.DONOTSAVECHANGES);           alert('All Done…?');      } } processCSV(); function readInCSV(fileObj) {      var fileArray = new Array();      fileObj.open('r');      fileObj.seek(0, 0);      while(!fileObj.eof) {           var thisLine = fileObj.readln();           var csvArray = thisLine.split(',');           fileArray.push(csvArray);      }      fileObj.close();      return fileArray; }

If you are stuck with the tweaking post back. No promises though.

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
New Here ,
Apr 02, 2010 Apr 02, 2010

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)

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
Guide ,
Apr 02, 2010 Apr 02, 2010

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).

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
New Here ,
Apr 02, 2010 Apr 02, 2010

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?

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 ,
Apr 02, 2010 Apr 02, 2010

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

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
New Here ,
Apr 02, 2010 Apr 02, 2010

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.

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 ,
Apr 02, 2010 Apr 02, 2010

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.    

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
New Here ,
Apr 03, 2010 Apr 03, 2010

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.

Script for AI CS4.jpg

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

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
Guide ,
Apr 03, 2010 Apr 03, 2010

Steve did you you test the posted code at all? You do not need to be a 'coder' just capable of a few text edits (as I can't look at your doc).

Have you tried using 'Senduit' or so other file sharing web server…

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.

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
New Here ,
Apr 03, 2010 Apr 03, 2010

Hey Muppet....

Thanks man...

Let me sort out these files on Senduit... and then I'll post a link.

Steve

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
Guide ,
Apr 03, 2010 Apr 03, 2010

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…

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
New Here ,
Apr 03, 2010 Apr 03, 2010

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

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 ,
Apr 03, 2010 Apr 03, 2010
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

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
New Here ,
Apr 03, 2010 Apr 03, 2010

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....

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
New Here ,
Apr 03, 2010 Apr 03, 2010

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:

  • A Movie to run you through a bunch of iterations, you'll see how mindless the repetition is — and how easy it is to make mistakes!
  • The font you'll need. It's safe, I've been using it for years.
  • Sample word strings and file names.
  • The AI and PNG folders so you can see the results of the exercise.
  • A two artboard file "Logo Build in AI CS4-Forum.ai", also in CS2.
  • The Master AI doc "Logo Master for AI Forum,ai", also in CS2.

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

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
Guide ,
Apr 04, 2010 Apr 04, 2010

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

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
New Here ,
Apr 04, 2010 Apr 04, 2010

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

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
New Here ,
Apr 04, 2010 Apr 04, 2010

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

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
Guide ,
Apr 04, 2010 Apr 04, 2010

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.contents;                     if (thisChar == thisChar.toUpperCase()) {                          capStyle.applyTo(genericText.characters, true);                     } else {                          lowerStyle.applyTo(genericText.characters, true);                     }                }                tmStyle.applyTo(genericText.characters[genericText.characters.length-2], true);                tmStyle.applyTo(genericText.characters[genericText.characters.length-1], true);                //dropShadow.applyTo(genericText);                                               var saveFile = new File(decodeURI(aiFolder) + '/' + fileName + '.ai');                saveAs(saveFile, aiOptions);                                var saveFile = new File(decodeURI(pngFolder) + '/' + fileName + '.png');                exportFile(saveFile, ExportType.PNG24, png24Options);           }           close(SaveOptions.DONOTSAVECHANGES);           alert('All Done…?');      }      app.userInteractionLevel = orginalUIL; } processCSV(); function isCSV(fileObj) {      var fileName = decodeURI(fileObj.name);      var extOffSet = fileName.lastIndexOf('.');      if (fileName.substr(extOffSet, fileName.length) == '.csv') return true; } function readInCSV(fileObj) {      var fileArray = new Array();      fileObj.open('r');      fileObj.seek(0, 0);      while(!fileObj.eof) {           var thisLine = fileObj.readln();           var csvArray = thisLine.split(',');           fileArray.push(csvArray);      }      fileObj.close();      return fileArray; }

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.

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
New Here ,
Apr 04, 2010 Apr 04, 2010

OK... let me give it a whirl and see what happens.....

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