Sunday, August 20, 2017

#1 2017-03-08 03:53:26 pm

BBdot1
Member
Registered: 2017-03-07
Posts: 2

applescript to change fill color of text

I'm using script debugger 6.04 to try to write a script to change the fill color of selected text to a defined RGB color in Illustrator.
Here's what I have so far:

tell application "Adobe Illustrator"
    set numArt to (count text frames of document 1)
    set selection to text frame 10 of current document
    set myText to contents of selection
    set fill color of myText to {class:RGB color info, R:0.0, G:0.0, b:100.0}
end tell

I get the error message "Can’t set «class aiFC» of "642706 (95-96, Code “K” Eng.)[958]" to {class:«class tRGi», R:0.0, G:0.0, «class LabB»:100.0}." when I run this but am too new at scripting to know what this means.

Any help in changing the selected text to RGB black would be greatly appreciated.

Thanks,
Brian


Filed under: applescript, Illustrator

Offline

 

#2 2017-03-09 03:42:08 am

EricLipton
Member
Registered: 2012-12-02
Posts: 17

Re: applescript to change fill color of text

tell application "Adobe Illustrator"
    tell current document
        set fill color of characters of text of text frame 10 to {class:RGB color info, red:0.0, green:0.0, blue:100.0}
    end tell
end tell


Kind Regards, Eric

Last edited by EricLipton (2017-03-09 03:43:45 am)

Offline

 

#3 2017-03-09 06:02:50 pm

BBdot1
Member
Registered: 2017-03-07
Posts: 2

Re: applescript to change fill color of text

Thank you Eric, this is exactly the help I needed to continue with my very first script.

Brian

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)