Archive for the 'applicationDidChangeScreenParameters:' Category

2012/10/14 ディスプレイ解像度の変更を検出


検出してどーするんだ? という疑問は残りますが、割と手軽に検出できます。なにせ、ハンドラ1つを追加するだけですから。

→ Xcode Project をダウンロード


– AppDelegate.applescript
– screenresolDetector

– Created by Takaaki Naganoya on 2012/10/13.
– Copyright (c) 2012年 Takaaki Naganoya. All rights reserved.

script AppDelegate
  property parent : class “NSObject”
property aWin : missing value
property aWinTitle : missing value
  on applicationWillFinishLaunching_(aNotification)
    – Insert code here to initialize your application before any files are opened
  end applicationWillFinishLaunching_
  on applicationShouldTerminate_(sender)
    – Insert code here to do any housekeeping before your application quits
return current application’s NSTerminateNow
  end applicationShouldTerminate_
on applicationDidChangeScreenParameters_(sender)
    say “Display Resolution Changed”
–aWin’s setTitle_(”Resolution Changed”)
  end applicationDidChangeScreenParameters_
end script

▼新規書類に ▼カーソル位置に ▼ドキュメント末尾に