The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniOutliner > OmniOutliner 3 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
how to applescript changing a row's background color? Thread Tools Search this Thread Display Modes
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:
Originally Posted by wfiveash View Post
What attribute can I use to just change a selected row's background color?
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
--

Last edited by RobTrew; 2010-10-28 at 01:29 PM.. Reason: Amended the code to use the default value correctly
 
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
 
Quote:
Originally Posted by RobTrew View Post
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
The irony of your solution didn't escape me. 8^)
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change linkback background color? capricium OmniOutliner 3 for Mac 0 2009-05-01 12:03 AM
Remove background color Euge OmniOutliner 3 for Mac 2 2008-04-23 12:27 PM
background color in main outline cemart OmniFocus 1 for Mac 1 2008-01-07 01:18 PM
Background Color Siggy OmniFocus 1 for Mac 3 2007-12-13 07:15 PM
Changing fill color in AppleScript action mduser63 OmniGraffle General 1 2006-06-27 09:23 PM


All times are GMT -8. The time now is 02:07 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.