The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   AppleScript "connect" properties (http://forums.omnigroup.com/showthread.php?t=14790)

rishig 2009-12-14 01:12 PM

AppleScript "connect" properties
 
In an AppleScript, I am connecting two objects, but I can't seem to use the "with properties" construct appropriately. I am an AppleScript novice, so maybe I have the syntax wrong? I am using the following line:

> set my_line to connect head_shape to tail_shape with properties {tail magnet:tail_mag_idx, head magnet:head_mag_idx}

Here both head_shape and tail_shape are shapes, each with a single magnet, and the values of tail_mag_idx and head_mag_idx are both 1. After I run the line above, the resulting line object (my_line) has 0 in the fields for head magnet and tail magnet. I can then explicitly set those fields below with the following lines:

> set tail magnet of my_line to tail_mag_idx
> set head magnet of my_line to head_mag_idx

After this, everything is as I would expect, so this is an easy enough workaround for my problem. Still, it would be nice to know why the one line syntax is not working. Anyone see an obvious problem with my syntax? Or is this a known bug in "connect"?

Thanks!


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

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