Search code examples
xcodemacosapplescriptminimizeapplescript-objc

In an Xcode mac osx AppleScript app (AppleScriptObjC), what is the command to I minimize the main app window?


I'm trying to write an app that should keep running after a button is clicked so I want to minimize it. I have the app main window theWindow connected to the placeholder

property theWindow : missing value

I have tried:

theWindow's performMiniaturize()
theWindow's miniaturize()

But I keep getting the message:

[NSView performMiniaturize]: unrecognized selector sent to instance 0x608000120280 (error -10000)


Solution

  • -[NSWindow miniaturize:]

    theWindow's miniaturize: me
    

    That said, why don't you just close the window and reopen it later if/as needed? (Make sure your app isn't configured to quit automatically when the window closes, of course.)