Skip to main content
Participant
Nov 14, 2024 4:54 PM UTC
Question

Script for dashed lines in illustrator

Hey all, 

 

I have to make a lot of technical drawings of garments at work, and i've been trying to create a script that would allow me to make different types of dashed lines super fast.

 

The script I use (or at least want to use) is supposed to offset the line to a given distance (this part works like a charm), and then transform the new line into a dashed line.

However, whenever I try to script a dashed line (that is not the default setting of 12pt/ 0pt), it just won't work (or kinda work).

What it does, even though I change the settings (to 2pt/2pt), is that it only picks up the first information (making it 2pt/0pt), making the dashed line appear full, since there is no space in between the dashes. 

 

Does anyone know how i could make this work? Or maybe just change the default dashed lines settings so that i don't have to change them when recording the script?

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Community Expert
Nov 15, 2024 12:43 PM UTC

You can save your dashed line as a Graphic Style - and so therefore crate the action to make the offset path and then apply the correct dashed line graphic style. I've attached a picture as an example.

 

Translate
Kurt Gold
Community Expert
Community Expert
Nov 14, 2024 5:27 PM UTC

How about providing your action set file (.aia) as well as a sample Illustrator document with some further instructions?

Translate
CarlosCanto
Community Expert
Community Expert
Nov 14, 2024 4:59 PM UTC

it seems you're trying to record an Action, is that right? not writing a script in Javascript?

Translate
Participant
Nov 14, 2024 5:01 PM UTC

Yes that's right!

Translate