minimize stack using applescript

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

minimize stack using applescript

Post by makeshyft » Wed Aug 05, 2015 5:53 pm

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?
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9645
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: minimize stack using applescript

Post by dunbarx » Wed Aug 05, 2015 6:53 pm

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

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: minimize stack using applescript

Post by makeshyft » Wed Aug 05, 2015 7:01 pm

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"
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3998
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: minimize stack using applescript

Post by bn » Wed Aug 05, 2015 8:04 pm

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

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: minimize stack using applescript

Post by makeshyft » Wed Aug 05, 2015 8:12 pm

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. :( :( :(
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3998
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: minimize stack using applescript

Post by bn » Wed Aug 05, 2015 8:21 pm

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

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: minimize stack using applescript

Post by makeshyft » Wed Aug 05, 2015 9:40 pm

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?
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3998
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: minimize stack using applescript

Post by bn » Wed Aug 05, 2015 9:51 pm

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

makeshyft
Posts: 220
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: minimize stack using applescript

Post by makeshyft » Wed Aug 05, 2015 9:58 pm

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....
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Post Reply

Return to “Mac OS”