how to applescript changing a row's background color?
I want the ability to quickly change one or more row's background color for highlighting purposes. I looked at the OO applescript dictionary and I only find attributes for changing a column's background color. What attribute can I use to just change a selected row's background color?
|
[QUOTE=wfiveash;88180]What attribute can I use to just change a selected row's background color?[/QUOTE]
[CODE]property pstrBackGd : "text-background-color" property plstRGBEmphasis : {65535, 57054, 42407} tell application id "com.omnigroup.OmniOutlinerPro3" try set oStyle to style of first selected row of front document on error return end try tell attribute pstrBackGd of oStyle if value is default value then set value to plstRGBEmphasis else set value to default value end if end tell end tell [/CODE] [COLOR="White"]--[/COLOR] |
Thanks for the tip. It bugs me that using the AppleScript Dictionary for OO I am unable to find anything about this in a way that makes it apparent what I need to use to access and change that attribute of a row.
|
One discovery technique is to list the attributes and capture a selection of their names in the clipboard:
[CODE]tell application id "com.omnigroup.OmniOutlinerPro3" try set oStyle to style of first selected row of front document on error return end try set refAttribs to a reference to attributes of oStyle set lstNames to name of refAttribs end tell set varResponse to choose from list lstNames OK button name "Place selections in Clipboard" with multiple selections allowed if varResponse is not false then set text item delimiters to return tell application id "com.apple.finder" set the clipboard to (varResponse as text) end tell set text item delimiters to space end if[/CODE] |
[QUOTE=RobTrew;88194]One discovery technique is to list the attributes and capture a selection of their names in the clipboard:
[CODE]tell application id "com.omnigroup.OmniOutlinerPro3" try set oStyle to style of first selected row of front document on error return end try set refAttribs to a reference to attributes of oStyle set lstNames to name of refAttribs end tell set varResponse to choose from list lstNames OK button name "Place selections in Clipboard" with multiple selections allowed if varResponse is not false then set text item delimiters to return tell application id "com.apple.finder" set the clipboard to (varResponse as text) end tell set text item delimiters to space end if[/CODE][/QUOTE] The irony of your solution didn't escape me. 8^) |
All times are GMT -8. The time now is 07:34 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.