Scoping woes

I’ve been trying to write an AppleScript automator action that duplicates the functionality of “Send Mail Message” but actually sends the message right away. So I have an action that has the main action view and a window that contains an ABPeoplePicker and three buttons (to, cc, bcc).

The button for opening the window (located in the action view) and the three buttons in the window containing the people picker are all wired to the same applescript and the scope is set to “global”. The script has a property that is used for storing a reference to the action view (filled in “awake from nib”) and I’d expect that property to be available independent of whether the handler was called from the people picker window or the main view.

Alas, this is no the case. Simple tests with a numeric property (counting clicks) show quite clearly that the view and the window each have a separate instance of the script (a behaviour I’d expect if I had stated “Object” as the scope in the Inspector window).

So: (Where) am I mistaken? Or have I simply stumbled upon a bug? Can anyone shed some light on this?

I use XCode 2.1 on 10.4

TIA,
Eike