« [pdfd]net.sourceforge.skim-app.pdfdをAcrobatで開く | トップページ | Curl用のURLコピーからヘッダー分離 »

[Music] 自動曲送り 曲送り(擬似フェードイン フェードアウト)

【スクリプトエディタで開く】

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
#   com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions


####1曲何秒聴く?
set numTimer to 30 as integer

###何曲
set numCntRep to 5000 as number

####何曲目
set numCnt to 0 as number

repeat numCntRep times
  
  tell application "Music"
    set sound volume to 100
    set objState to (player state)
    if objState is playing then
      log "再生中"
      set objNowTrack to current track
      
      set objNowTrack to current track
      name of objNowTrack as text
      album of objNowTrack as text
      artist of objNowTrack as text
      ##################
      delay numTimer
      ##################
      ###フェードアウト
      set sound volume to 100
      set numVolume to 100 as integer
      repeat 10 times
        set sound volume to numVolume
        set numVolume to numVolume - 10 as integer
        delay 0.1
      end repeat
      ##################
      ###次の曲
      next track
      ##################
      ###フェードイン
      set numVolume to 10 as integer
      repeat 10 times
        set sound volume to numVolume
        set numVolume to numVolume + 10 as integer
        delay 0.1
      end repeat
    else if objState is paused then
      set sound volume to 100
      log "停止中"
      set objNowTrack to current track
      play
    else if objState is stopped then
      set sound volume to 100
      log "停止中"
      set objNowTrack to current track
      play
    end if
  end tell
  
  set numCnt to (numCnt + 1) as number
  log numCnt
  ---リピートの終わり
end repeat




|

« [pdfd]net.sourceforge.skim-app.pdfdをAcrobatで開く | トップページ | Curl用のURLコピーからヘッダー分離 »

AppleScript Music」カテゴリの記事