NSWindowを非表示にする [AppleScript辞書はつくれるか?]
script AppDelegate
property parent : class "NSObject"
property flg : true
on button1_(sender)
set my flg to false --非表示
delay 1
set my flg to true --再表示
end button1_
-- IBOutlets
property theWindow : missing value
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
(*
on applicationShouldTerminateAfterLastWindowClosed_(sender)
return true
end applicationShouldTerminateAfterLastWindowClosed_
*)
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script
on applicationShouldTerminateAfterLastWindowClosed_(sender)
return true
end applicationShouldTerminateAfterLastWindowClosed_
という部分が生きてると、ウインドウが閉じた瞬間にアプリケーションが終了してしまうので外しておこう。
どうでしょう?
(※)本文中に『(仮に)flgに変更』という書き方をしてますが、この変数はなんでも良いのです。
なにかわかりやすい他単語に変更しても良いです。
コメント 0