Make new window programatically

Hey!, well another problem here.
What I’m trying to do is to make a window wich I have not and will not define on the IB. Instead I want to create it programatically.
I have a button wich will create a new window each time it is pressed. The problem is that I might be on the wrong way 'cause some properties for the window acts OK and other don’t.
Here’s part of the code:

on clicked theObject
make new window with properties {title:“AAA”, name:“BBB”, floating:true, bounds:{100, 2, 2, 2}, visible:true}
end clicked

Firstly it shows an error but the window is created! and it shows the title. But the the script doesn’t care about other properties (apart from “visible” wich if it isn’t there the window don’t show up) such as modal or bounds.

The only way I can avoid getting an error in the middle of the script is to put the line “of window of theObject” next to “make new window” and before “with properties”.

Additionally I’d like to create a custom content for those windows wich yes, I have created previously on IB, is there any way I can do this? to put those contents to the new window, and then the controls in that control would refer to the other controls on the same window calling to the “window of theObject”, is that possible?

well, hope you understand…

saludos from Argentina!

Hi!

I have absolutely no experience haciendo este tipo de cosa, but this works here:

set k to make new window at end
set size of k to {400, 500}
set visible of k to true

Some window theorical properties may work, some other not, but a little of investigation should do most of things…

Cheers! :wink:

nope…now I’ve been able to put all the properties that I’ve wanted (just after the make and before the visible) but the problem is that I have to put a name to the window, with that, all works OK!, but I want multiple windows, so I cannot choose a name, so I’ve tried passing the variable theName as a randomnumber. It also works fine BUT… the window opens onto my main window…ok, it’s weird but the content of my widow just turns into my “new window” which has to be another window and NOT the same! HEY! what’s that???..

I’ve used your code but same thing happens…it has to do witht the “make new window”…I just can’t figure it out! !

thanks! ands saludos from Argentina! :x

Under my point of view, AppleScript Studio is still beta, and what you’re trying to do is a heavy work…
I’d try this same question directly at apple’s applescript-studio-users-list, where you can talk to some apple’s ass engineers and other gurus http://www.lists.apple.com/mailman/listinfo/applescript-studio