Macに接続・搭載しているディスプレイのスリープ/スリープ復帰が行われたノーティフィケーションを受信するAppleScriptです。
AppleScript名:ディスプレイがスリープした.scptd |
— – Created by: Takaaki Naganoya – Created on: 2019/01/25 — – Copyright © 2019 Piyomaru Software, All Rights Reserved — use AppleScript version "2.4" — Yosemite (10.10) or later use framework "Foundation" use framework "AppKit" use scripting additions set aCenter to current application’s NSWorkspace’s sharedWorkspace()’s notificationCenter() aCenter’s addObserver:me selector:"notifDispSleeped:" |name|:"NSWorkspaceScreensDidSleepNotification" object:(missing value) on notifDispSleeped:aNotif say "Display sleeped" end notifDispSleeped: |
AppleScript名:ディスプレイがスリープから復帰した.scptd |
— – Created by: Takaaki Naganoya – Created on: 2019/01/25 — – Copyright © 2019 Piyomaru Software, All Rights Reserved — use AppleScript version "2.4" — Yosemite (10.10) or later use framework "Foundation" use framework "AppKit" use scripting additions set aCenter to current application’s NSWorkspace’s sharedWorkspace()’s notificationCenter() aCenter’s addObserver:me selector:"notifDispWaked:" |name|:"NSWorkspaceScreensDidWakeNotification" object:(missing value) on notifDispWaked:aNotif say "Display waked" end notifDispWaked: |
More from my site
(Visited 159 times, 1 visits today)