The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniOutliner 3 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=9)
-   -   Toggling color of selected rows between 2 or more colors (http://forums.omnigroup.com/showthread.php?t=20302)

RobTrew 2011-03-01 11:54 AM

Toggling color of selected rows between 2 or more colors
 
Further to a [URL="http://forums.omnigroup.com/showthread.php?t=20290"]similar script[/URL] 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
[/CODE]

RobTrew 2011-03-01 01:20 PM

Amended above - thanks to WhPalmer4 for diplomatically pointing out that it needs to be selected rows [B]where topic is not ""[/B] - trying to toggle the color of a textless row would trip an error ...


All times are GMT -8. The time now is 12:22 PM.

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