Having trouble with "theWindow" and the controller variables

Hello Everyone,

I’ve been following the Mail Search tutorial in one of apple’s developer guides for apple script studio. And i’m having trouble with two things.

How do i define theWindow variable? I’ve looked at a lot of examples in the developer folder, and they all say something like:

display alert “Missing Information” as critical message theMessage attached to theWindow

But if i copy that accross to mine, i get an error saying the variable theWindow is not defined, but in the example code i can’t find anywhere where its been defined. So i’m kind of stuck :confused:

Help?

EDIT> I seem to be able to bypass theWindow by just setting it to “the window of theObject” instead. Is this right? a workaround? or best avoided?

Model: iMac 2008
Browser: Safari 4
Operating System: Mac OS X (10.5)

Hi.

your first trouble is posting in the wrong forum. :wink: Please post AppleScript Studio topics into the Xcode forum.

In your example the variable theWindow is a reference to the window, which the display alert panel is attached to
You can also write


display alert "Missing Information" as critical message theMessage attached to window "main"

if there is a window “main” defined and named in Interface Builder

Ok, thanks for the help. It was just this theWindow variable was driving me crazy but i couldn’t find where they define it. :slight_smile: