Hello all. I've been fooling around with applescript studio for some time but and I've solved many problems, but I have something that I believe should be simple, yet it is not. 
Basically what I have is an AppleScript Studio gui with a min and max size. I would like to expand the box to the max size, if it is the min size by clicking a button after launch.
In general what I do is make small code snippets in Apple editor then if it works, I move it over to applescript studio and make the appropriate changes. The problem I have is the below snippet works just fine in AppleScript Editor, however when I link the code to a button on my GUI in AppleScript Studio, the application just lags out and does nothing.
Any help would be appreciated.
Basically what I have is an AppleScript Studio gui with a min and max size. I would like to expand the box to the max size, if it is the min size by clicking a button after launch.
In general what I do is make small code snippets in Apple editor then if it works, I move it over to applescript studio and make the appropriate changes. The problem I have is the below snippet works just fine in AppleScript Editor, however when I link the code to a button on my GUI in AppleScript Studio, the application just lags out and does nothing.
Any help would be appreciated.
Code:
tell application "MyApplication" to activate
tell application "System Events" to tell application process "MyApplication"
try
get properties of window 1
set size of window 1 to {439, 300}
on error errmess
log errmess
-- no window open
end try
end tell