View Single Post
Thus, to search and replace text formatting properties:

Code:
-- Search and replace formatting properties
tell application id "OGfl"
	tell front window
		tell its canvas
			set oShape to item 1 of shapes
			
			set refText to a reference to text of oShape
			tell refText
				-- change anything redder to green
				repeat with oRun in attribute runs
					set {lngR, lngG, lngB} to color of oRun
					if (lngR > lngG and lngR > lngB) then set color of oRun to {0, 65535, 0}
				end repeat
			end tell
		end tell
		
		set zoom to zoom * 0.99
		refText
	end tell
end tell
and to simply list them:
Code:
-- List formatting properties
tell application id "OGfl"
	tell front window
		tell its canvas
			set oShape to item 1 of shapes
			
			tell text of oShape -- still an uncoerced reference
				set lstProps to properties of attribute runs
			end tell
		end tell
	end tell
end tell
--

Last edited by RobTrew; 2012-02-03 at 03:32 AM..