Been working on this for a while now, just cant get it, tried loads of different ways but nothing I do seems to work.
What I need to do is change the font of all text in a document and the font size of the text also, something along these lines
tell application "Adobe Illustrator"
activate
if (count text frames in document 1) > 0 then
set textItemCount to count text frames in document 1
repeat with i from 1 to textItemCount
set properties of text frame i of document 1 to {text font:"Times"}
end repeat
end if
end tell
Changing text in illustrator is tricky at times! via applescript
you can change the font in the built in option in illustrator under the type menu “Find font”
thats an option.
But if you insist on going down the scripting route then you may have to jiggle with this a bit.
tell application "Adobe Illustrator"
set t to every text frame of document 1
set y to count of every text frame of document 1
repeat with i in t
set the text font of text of i to text font "Times-Italic" -- or a number like 22 this number is the index of the text font
end repeat
repeat with n from 1 to y
tell document 1
tell text frame n
tell text range
tell every line
set size to 20
end tell
end tell
end tell
end tell
end repeat
end tell