Home Creators Posts Import Register Favorites Logout

Content

Subtitle: Moogs complains, but "professionally"

I wrote this but got tired of editing it. Maybe you want to read it? IDK.

For the latest update we changed the copyright year on all the cards. Like most of our mass card updates I did this with a script to control Adobe Illustrator. Illustrator is a tool designed to support a largely manual work process and its internal code really reflects this. Internally, it uses old design patterns that will frustrate a modern developer, and working with it involves a very large amount of trial and error. To those of you doing your own projects where you need to make programmatic updates. I would recommend you look extensively for an alternative solution that still has all of the typographic features you need.

If you use Illustrator, the biggest takeaway here is the longer you can put off converting card data into Illustrator files, the fewer edits you will have to make within Illustrator and the better your experience will be. If we were starting a long term project I would have taken the time to create a proper build pipeline. Since we were finishing a long term project I created what was essentially a bunch of throw away conversion scripts. 

Pick your starting point

Start with hand made templates and alter them as needed in code (we did this)

If you can get the build time down, it may be advantageous to generate the illustrator files completely from code.

Objects need to be visible to be manipulated, so your template variations (like single vs split rules text boxes) should be high in the structure, probably just below the root.

Keep your object names consistent across variations, honestly just a good practice

Use symbol libraries to make things like icon replacement easier

Documentation: https://ai-scripting.docsforadobe.dev/

Other Notes

Illustrator does not support relative paths to linked files. Carrot and I had to make our source controlled directories the same on our individual PCs

Illustrator’s getByName() function on its collections returns an exception when the item isn’t found

Groupings can be either layer objects or group objects, possibly others. 

The difference isn’t visible on the UI

It was weeks from the time we created our templates until we started programming against them, so we have no idea which UI operations create which object types

There doesn’t seem to be a generic child object collection

You need to know a child object’s type to locate it

Z order of all child objects is difficult to determine

Some objects have a visible property and others have a hidden property

textFrames do not have name properties, you need to locate them by their current contents

Multiline textFrame size cannot be determined without rasterizing the textFrame

This makes automatic resizing of text size more difficult

Manual edits will still be required, this just gets you close

Our MSE build pipeline had explicit font sizes for text boxes stored in theJSON  card data and it was very nice

The default export size is tiny. Recommend a 600% horizontal and vertical scaling as a starting point

Comments

No comments found for this post.