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

 
Toggling color of selected rows between 2 or more colors Thread Tools Search this Thread Display Modes
Further to a similar script for OmniGraffle:

Attaching a script like this to a keyboard shortcut, using something like Keyboard Maestro or Fastscripts, enables one to quickly switch the text color of selected rows. (This version affects only the topic text).

Code:
-- TOGGLE/CYCLE TEXT OF SELECTED ROWS BETWEEN BLACK, GRAY AND RED

property plstBlack : {0, 0, 0}
property plstGray : {32767, 32767, 32767}
property plstRed : {65534, 0, 0}

tell application id "com.omnigroup.OmniOutlinerPro3"
	try
		tell front document
			set idTopic to id of topic column
			set refRows to a reference to (selected rows where topic is not "")
		end tell
	on error
		return
	end try
	if (count of refRows) < 1 then return
	
	-- GET THE NEXT COLOR IN THE SEQUENCE
	tell (text of cell id idTopic of first item of refRows)
		set lstColor to its color
		if lstColor = plstGray then
			set lstNewColor to plstRed
		else if lstColor = plstBlack then
			set lstNewColor to plstGray
		else
			set lstNewColor to plstBlack
		end if
	end tell
	
	-- AND APPLY THE NEW COLOR TO ALL SELECTED ROWS
	set color of text of cell id idTopic of refRows to lstNewColor
end tell

Last edited by RobTrew; 2011-03-01 at 01:19 PM..
 
Amended above - thanks to WhPalmer4 for diplomatically pointing out that it needs to be selected rows where topic is not "" - trying to toggle the color of a textless row would trip an error ...
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toggling (cycling) the color of text nodes RobTrew OmniGraffle General 2 2011-03-01 01:40 PM
Script to copy columns (and any selected rows) to new doc RobTrew OmniOutliner 3 for Mac 0 2010-06-07 02:47 AM
Is there a way to have check boxes only on selected rows? MichaelG OmniOutliner 3 for Mac 5 2008-05-30 12:05 PM
Reverse order of selected rows random1destiny OmniOutliner 3 for Mac 1 2007-10-15 03:30 PM
Fully expand collapse only selected rows random1destiny OmniOutliner 3 for Mac 2 2007-09-24 08:33 AM


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


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