View Single Post
While the connect command does ignore head magnet and tail magnet properties, this seems to be a case where setting the properties as a second step works. For example:


Code:
tell application "OmniGraffle Professional 5"
	
	tell canvas of front window
		set firstShape to make new shape at end of graphics with properties {draws shadow:false, size:{100, 100}, origin:{50, 50}, magnets:{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, thickness:3}
		
		set secondShape to make new shape at end of graphics with properties {name:"Circle", draws shadow:false, size:{100, 100}, origin:{200, 200}, magnets:{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, thickness:3}
		
	end tell
	
	set theLine to connect firstShape to secondShape with properties {thickness:2.0, line type:orthogonal, head type:"FilledArrow"}
	set head magnet of theLine to 4
	set tail magnet of theLine to 1
	
end tell
It also works with pre-existing shapes.

You do see the process of drawing and then changing as two visual steps. If that's a problem you can make the original thickness of the line zero and then set it to something else after setting the magnets.

Last edited by john.gersh; 2012-12-06 at 10:36 AM..