Guest
2011-02-28, 11:13 AM
Or, to toggle the text color of all selected shapes together, something like:
Code:
property plstBlack : {0, 0, 0}
property plstGray : {32767, 32767, 32767}
property plstRed : {65534, 0, 0}
tell application id "com.omnigroup.OmniGrafflePro"
try
set lstSeln to selection of front window
on error
return
end try
set lngSelns to count of lstSeln
if lngSelns < 1 then return
-- FIND THE FIRST SHAPE IN THE SELECTION WHICH HAS TEXT (IGNORE LINES)
set blnFound to false
repeat with oSeln in lstSeln
if (class of oSeln = shape) and (text of oSeln ≠ "") then
set blnFound to true
exit repeat
end if
end repeat
if blnFound then
-- GET THE NEXT COLOR IN THE SEQUENCE
tell (text of oSeln)
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 SHAPES
repeat with oSeln in lstSeln
if (class of oSeln = shape) and (text of oSeln ≠ "") then set color of text of oSeln to lstNewColor
end repeat
end if
end tell
Last edited by RobTrew; 2011-03-01 at 01:36 PM..