View Single Post
The textPosition property in the OmniGraffle applescript library correctly positions text within a "Rectangle" shape, but has a bug which misplaces text in "Circle" shapes.



Code:
property lstTextPosn : {0, 0}

tell application id "OGfl"
	tell front canvas of front document
		-- ADD A LABEL
		make new shape with properties ¬
			{size:{200, 20}, origin:{120, 50}, name:"Rectangle", draws stroke:false, fill:no fill, draws shadow:false, text:{font:"Verdana", size:16, color:{65500, 0, 0}, text:"textPosition: {0,0}", alignment:center}}
		
		-- RUN A TEST:
		-- RECTANGLE: TEXTPOSITION PROPERTY WORKS
		make new shape with properties ¬
			{name:"Rectangle", origin:{100, 100}, size:{100, 100}, textPosition:lstTextPosn, text:{alignment:center, text:"This works"}} ¬
				
		
		-- CIRCLE: TEXTPOSITION PROPERTY MISPLACES THE TEXT -- *OFF* CENTER 
		make new shape with properties ¬
			{name:"Circle", origin:{250, 100}, size:{100, 100}, textPosition:lstTextPosn, text:{alignment:center, text:"bug: off center"}}
	end tell
end tell