• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Set Layer Color to color name

New Here ,
Jul 18, 2013 Jul 18, 2013

Copy link to clipboard

Copied

This works:

set layer color of layer 1 to light blue

This doesn't:

set listOfColors to {"light blue", "green", "blue"}

set layer colour of layer 1 to item 1 of listOfColors

I can see that item 1 is text, and light blue is not text - is there some way to coerce it? Maybe I'm just being lazy but if color names exist, I'd rather use them.

Thanks for any help,

Emma

TOPICS
Scripting

Views

460

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Jul 18, 2013 Jul 18, 2013

Those UI colours are app constants so NO double quotes… Also NO u in color on last line…

tell application "Adobe InDesign CS5"

          tell the active document

 

                    set layer color of layer 1 to light blue

 

                    set listOfColors to {light blue, green, blue}

 

                    set layer color of layer 1 to item 2 of listOfColors

 

          end tell

end tell

Votes

Translate

Translate
Guru ,
Jul 18, 2013 Jul 18, 2013

Copy link to clipboard

Copied

Those UI colours are app constants so NO double quotes… Also NO u in color on last line…

tell application "Adobe InDesign CS5"

          tell the active document

 

                    set layer color of layer 1 to light blue

 

                    set listOfColors to {light blue, green, blue}

 

                    set layer color of layer 1 to item 2 of listOfColors

 

          end tell

end tell

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2013 Jul 18, 2013

Copy link to clipboard

Copied

LATEST

How stupid am I??? Doh! Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines