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 > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Working with the Text of a Shape in OmniGraffle Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
It has always been possible to create styled text, but a couple of problems with changing the color etc of a part of a text are:
  1. Automatic type conversion of text in Applescript,
  2. buggy screen updating in OmniGraffle.

Some work-arounds are:
  1. Indirection (use of references rather than simple variable assignments),
  2. micro zoom adjustments of the OG screen.

You can change the color of the Nth word by applying that change to a reference (bypassing automatic conversion of the text to a string variable), but you won't see the result on the OG screen until you force a rewrite by making a small change to the zoom level:

Code:
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
			set color of word 3 of refText to {0, 0, 65535}
		end tell
		
		set zoom to zoom * 0.99
	end tell
end tell
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating a shape in OmniGraffle ekin OmniGraffle General 4 2013-03-21 01:30 AM
When I click an shape why does it always think I want to edit the text? edgley OmniGraffle General 9 2012-04-24 01:20 PM
Shadow from text inside shape mlevin777 OmniGraffle General 4 2011-05-27 09:06 AM
Control shadow of Shape Text? Sophie OmniGraffle General 3 2010-05-06 01:52 PM
Text to shape conversion digimarkus OmniGraffle General 2 2009-10-14 12:26 PM


All times are GMT -8. The time now is 12:10 AM.


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