Skip to main content
Known Participant
December 21, 2023
Question

How to export all styles of a text to a file?

  • December 21, 2023
  • 1 reply
  • 1173 views

Is there any way to export all styles  (font size, color, alignment, stroke width, line height,...) of a text to a file via jsx? I want to use this text styles to the texts of another Ai file.

This topic has been closed for replies.

1 reply

Legend
December 22, 2023

If that means character styles or paragraph styles, you can save the document as just an Illustrator file and load it with importCharacterStyles or importParagraphStyles.

// import
var doc = app.documents[0] ;
var aiFile = new File('~/Desktop/style.ai') ;
doc.importCharacterStyles(aiFile) ;
doc.importParagraphStyles(aiFile) ;

 

Known Participant
December 25, 2023

How to export character styles or paragraph styles in Illustrator?  ui or jsx?

test3.ai 

Legend
December 25, 2023

Simply export the Illustrator file containing character styles and paragraph styles as an ai file with saveAs. It can be achieved both in ui and jsx.

 

Or do you mean that you have not defined them as character styles or paragraph styles, but just specified fonts, sizes, colors, etc.?