Use AI Script to Turn SVG Groups into Layers
SignAgent can export Sign Artwork as SVGs that look great! However, part of the export process groups all of the information into groups within a single layer, which can cause issues with some production processes. This tutorial will teach you how to use a script to automatically transform these groups into separate layers, while maintaining all the correct content.
For a basic overview of using Scripts in Illustrator, check out this article: Automation with Scripts
In the above image, you can see an original SVG opened within Illustrator. This artwork was exported directly from our system, with no modifications made after the fact.
Note that everything is under the main Layer "Preview", and everything is in groups, rather than separated into logical fields or segments.
1. Download the Script
Download the above script to use within Adobe Illustrator. You can save it anywhere you like, but to make it easy to find, we recommend saving it within Adobe Illustrator's Scripting folder, inside a folder called "SignAgent"
2. Use the Script
Open up your SVG in Adobe Illustrator, if you haven't already. Then, go to File > Scripts > Other Script...
In the following dialog box, choose wherever you saved this new script, and then choose Open.
You can see now that all items have been ungrouped and separated into their appropriate layers. By having the fields named appropriately within SignAgent, you can have these layers match exactly what your production machines are going to be expecting.
OPTIONAL: Set up an Action
If you're going to be doing this a lot, or in batches, you'll probably want to set this up as an action so you can access it easily or assign it a keyboard shortcut. This segment of the tutorial will teach you how to do that.
For a basic overview of using Actions in Illustrator, check out this article: Automation with Actions
1. Make the Script a Preset (for easier access)
Moving the script to the folder in the image above will make it available directly from the File menu in Illustrator. By default (on Mac, for Adobe Illustrator CC 2019), it's within Adobe Illustrator CC 2019/Presets/en_US/Scripts
Note that if you currently have Illustrator open, you'll have to restart it at this step to make the Script file show up in the File menu.
2. Open the Actions Window
To do this, go to the Window menu within Illustrator, and then choose Actions
3. Create a New Set called SignAgent
Click the "Create New Set" button within the Actions window, and name the new set "SignAgent"
4. Create a New Action for "Groups to Layers"
Click the Create New Action button, and then name the New Action "Groups to Layers", and make sure it's within the set SignAgent.
You can also add a Function Key if you like. When you're ready, click Record
5. Add Menu Item: Groups to Layers
Finally, add the menu item to the Action by doing the following:
- Click the Actions Menu button
- Choose Insert Menu Item...
- Go to the File Menu > Scripts > GroupsToLayers
- Click OK.
The last thing to do is click "Stop Recording"
You can now use your Action (and keyboard shortcut) to run this script whenever you like!