Page 1 of 1

minimize stack using applescript

Posted: Wed Aug 05, 2015 5:53 pm
by makeshyft
Dear livecoders

it baffles me that no one has really asked or answered this question ......

I tried the following to minimize application window in Mac OS X

the DoCommand of button "Minimize" contains:

tell application "UMP"
set miniaturized of window 1 to true
end tell

on mouseUp:

do the DoCommand of me as "AppleScript"
answer the result

end mouseup

nothing happens... no answerwindow appears....

why doesn't this work?

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 6:53 pm
by dunbarx
Hi.

Don't know much about Applescript, but is the middle line of code you are executing as AppleScript valid? Not sure how a runtime error in that world would go down. And the "tell" command can access "UMP" whatever that is? Same thinking there.

I assume that the "mouseUp" handler is indeed in the button "Minimize"?

Craig Newman

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 7:01 pm
by makeshyft
I got the applescript code from an answer on stackoverflow

http://stackoverflow.com/questions/3564 ... dow-in-mac

UMP is the name of my application .... as specified in the standalone settings....

yes mouseup handler is in the button "Minimize"

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 8:04 pm
by bn
From my understanding Livecode has only limited support for AppleScript. Livecode is not scriptable as e.g. Safari.

Incomming Livecode supports the required suite like quit etc.

As for other AppleEvents it only handles evaluate and do script.

Did you try "set the iconic of this stack to true"? In the IDE this puts the stack into the dock on MacOSX.

Kind regards

Bernd

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 8:12 pm
by makeshyft
Hi Bernd,

That line doesn't work for me on Mac OS X ...works on windows....

Thats why I started to investigate another way of doing it..... my wife's little airbook is my testing ground, and the "set iconic" doesn't work. :( :( :(

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 8:21 pm
by bn
Hi MakeShift,

I just tried a minimal standalone on MacOSX 10.9.5. using LC 7.1 DP1
One card one button

script of button

Code: Select all

on mouseUp
   set the iconic of this stack to true
end mouseUp
and it worked.

What are your specs?

Kind regards
Bernd

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 9:40 pm
by makeshyft
she is running 10.6.8 .... so i tried to send the message "set the iconic of this stack to true" to the stack and nothing happens.

i guess i should report it as a bug?

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 9:51 pm
by bn
Hi Tom,

what exactly are you trying to achieve. I am not clear about this.

Do you want to let the user of the app minimize the window (stack) of the app? Or do you want to remote-control the app and send it a minimize message?

did you try to do a minimal standalone as described above?

Kind regards
Bernd

Re: minimize stack using applescript

Posted: Wed Aug 05, 2015 9:58 pm
by makeshyft
my app runs in fullscreen mode..so i had to create my own buttons to close and minimize...... closing works... minimize doesn't .....

thats all..nothing fancy....simple task ....

I jsut tried the empty stack..and it worked..... ... though only in the ide.

hhhmmmm.... ok...i will investigate more..... thanks for taking your time with this ...

will return with a verdict, though i suspect that now i will be able to track down the issue knowing that it actually is supposed to work....