View Single Post
Just for the record - john.gersh's solution works well, producing a link along the shortest path between the shapes.

Code:
property pstrArrow : "FilledArrow"
property plstRed : {65535, 0, 0}
property plstCenter : {0, 0}

tell application id "OGfl"
	tell (make new document)
		tell front canvas
			-- DISABLE AUTOMATIC LAYOUT
			set automatic layout of its layout info to false
			
			-- GET RELATIVE UNITS
			set {rX, rY} to page size
			set rSize to rX / 10
			set rDown to rY / 3
			
			-- MAKE SHAPES WITH MAGNETS AT THEIR CENTERS
			set shapeA to make new shape with properties {name:"Circle", origin:{rDown, rDown}, size:{rSize, rSize}, magnets:{plstCenter}}
			set shapeB to make new shape with properties {name:"Circle", origin:{rDown + (rSize * 1.3), rDown}, size:{rSize, rSize}, magnets:{plstCenter}}
			
			-- CONNECT THE SHAPES WITH A LINE
			tell (make new line with properties {stroke color:plstRed, head type:pstrArrow}) to set {source, destination} to {shapeA, shapeB}
		end tell
	end tell
end tell