Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@trodrigu
Created July 23, 2018 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trodrigu/90f85af2b141ac6165a8dc6eea2029c9 to your computer and use it in GitHub Desktop.
Save trodrigu/90f85af2b141ac6165a8dc6eea2029c9 to your computer and use it in GitHub Desktop.
make custom dog name in illustrator
set saveLocation to ((path to desktop) as string)
set fullPath to saveLocation & "newDogName"
set newFilePath to fullPath & ".svg"
log fullPath
tell application "Adobe Illustrator"
activate
make document with properties {name:"dogName"}
set theFrame to (make new text frame in current document with properties {contents:"Chi Chi", kind:area text, name:"notes"})
make new character style in document 1 with properties {name:"dog Name Character Style"}
set the size of character style "dog Name Character Style" of document 1 to 40
set destFont to text font "Laughing-and-Smiling"
set the text font of character style "dog Name Character Style" of document 1 to destFont
apply character style character style "dog Name Character Style" of document 1 to the text range of text frame "notes" of document 1
tell application "System Events" to tell process "Adobe Illustrator"
key code 53
keystroke "o" using shift down
key code 36
key code 48
key code 126 using shift down
key code 126 using shift down
key code 126 using shift down
key code 125 using shift down
key code 36
end tell
save current document in file fullPath as Illustrator with options {class:Illustrator save options, compatibility:Illustrator 15, font subset threshold:0.0, embed linked files:false, save multiple artboards:false}
AST click at {20, 140} number of clicks 1
AST click at {585.8828125, 697.8125} number of clicks 1
AST click at {260, 20} number of clicks 1
AST click at {260, 210} number of clicks 1
tell application "System Events" to tell process "Adobe Illustrator"
key code 36
end tell
export current document to file newFilePath as SVG
close current document saving no
display dialog "Dog name SVG created on your Desktop."
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment