Rather than waiting too piously for an Omni-solution on this one (those guys are busy) here is an experimental solution - an applescript which seems to be working for me, and which another contributor to this forum has been kind enough to test.
i.e. fairly drastic - so make a back-up and experiment first ...
- For each attribute run in the text of each shape in the canvas of the current window, it records the text properties that OmniGraffle actually understands,
- deletes the text entirely (to zap its background color),
- and then tries to reset the text and its formatting to the cleaned list of attribute run properties.
i.e. fairly drastic - so make a back-up and experiment first ...
Code:
-- VER 0.3 -- CLEAR ANY TEXT BACKGROUND COLOR FROM SHAPES RESULTING FROM THE PASTING OF MATERIAL FROM OMNIOUTLINER, VISIO, SAFARI ETC. -- EXERCISE CAUTION - THIS IS FAIRLY DRASTIC: -- 1. COPIES THE TEXT ATTRIBUTE RUN PROPERTY LISTS FOR EACH SHAPE -- 2. PURGES THESE OF NOISE (CLASS PROPERTY) AND BUGS (THERE IS A BUG IN THE TEXT PROPERTY OF OG5 ATTRIBUTE RUNS, SEE BELOW) -- 3. **ENTIRELY DELETES** ALL TEXT FROM THE SHAPE -- 4. ATTEMPTS TO RECREATE THE TEXT USING THE COPIED PROPERTIES -- NB ONLY USE ON A FILE WHICH HAS BEEN BACKED UP ... tell application id "OGfl" tell canvas of front window repeat with oShape in shapes set refText to (a reference to text of oShape) set lstAttribProps to properties of attribute runs of refText set lstClean to {} repeat with oRun in lstAttribProps set {varOff, varSup, varAlign, blnUnderlined, lstColor, strText, strFont, rSize} to {baseline offset, superscript, alignment, underlined, its color, its text, font, size} of oRun set strText to item 1 of strText -- there seems to be a bug in the text property of an attribute - instead of a string it returns a list which includes the name of the font set end of lstClean to {text:strText, font:strFont, size:rSize, color:lstColor, baseline offset:varOff, superscript:varSup, alignment:varAlign, underlined:blnUnderlined} end repeat -- RESET THE TEXT TO THE COPIED PROPERTY LIST tell oShape to set its text to lstClean end repeat end tell end tell
Last edited by RobTrew; 2012-02-08 at 04:07 AM..