Notification

AppleScript名:Notification
— Created 2017-10-13 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"

property NSDistributedNotificationCenter : a reference to current application’s NSDistributedNotificationCenter

on run
  NSDistributedNotificationCenter’s defaultCenter()’s addObserver:me selector:"statusChanged:" |name|:"com.apple.iTunes.playerInfo" object:(missing value)
  
end run

on statusChanged:sender
  tell application id "com.apple.iTunes"
    try
      tell current track
        set anAlbum to album
        
set aName to name
        
set anArtist to album artist
        
set aRating to rating
      end tell
    on error
      return
    end try
  end tell
  
display notification aName
end statusChanged:

★Click Here to Open This Script 

Please follow and like us:

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です