Apple script

Editor

<br></br>/Applications/Utilities/AppleScript Editor.app/

Memo

tell command to application

<br></br>tell application “iTunes”

     pause

end tell

pass arguments

<br></br>on run argv

     return argv

end run

set values

<br></br>set hoge to 1234

iTunes Suite

<br></br>/var/folders/gt/23ssj_td0nv7rr4k_cq9zh2w0000gn/T/iTunes.sdef

itunes_controller

code

<br></br>on run argv

     tell application "iTunes"

          set command to first item of argv

          if command = "play" then

               play

          else if command = "pause" then

               pause

          else if command = "next" then

               next track

          else if command = "prev" then

               previous track

          else

               return "command not found"

          end if

     end tell

end run

usage

<br></br>$ osascript itunes_controller.scpt pause

Document

https://developer.apple.com/library/mac/documentation/applescript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html#//apple_ref/doc/uid/TP40000983-CH208-SW1

http://www.tonbi.jp/AppleScript/