[Solved] Omnigraffle: set color of text OR shape

Trying to merge two shortcuts in one.

Separately they work fine, but now I'm trying to detect if fill:no fill is true to know it's a text-only element. Otherwise, it detects it's a shape with a fill color.

tell application id "OGfl"
   set lstSeln to selection of front window
   set oShape to item 1 of lstSeln
   tell canvas of front window
      if fill is "no fill" then
         set color of text of oShape to {1, 1, 1, 1}
      else
         set fill color of oShape to {1, 1, 1}
      end if
   end tell
end tell

Got it working.  :smiley:

tell application id "OGfl"
   set lstSeln to selection of front window
   set oShape to item 1 of lstSeln
   set theText to fill of oShape as string
   tell canvas of front window
      if (theText as string) does not contain "no fill" then
         set fill color of oShape to {1, 1, 1}
      else
         set color of text of oShape to {1, 1, 1, 1}
      end if
   end tell
end tell

Needed to add the "as string" line.

Looks a little bit ugly with the "does not contain no fill", but other than that, works fine :+1: