0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AppleScriptでlight-play

Posted at

雪豹でlight-playをビルドして、iTunesで保存したALACなアルバムのフォルダーをドラッグ&ドロップで再生できるようにしてみました。

ALPlay
on open theDroppedItems
        set atServer to "192.168.0.53"
 
        repeat with a from 1 to count of theDroppedItems
                set theCurrentItem to item a of theDroppedItems
                tell application "Finder"
                        set folderContents to every item of theCurrentItem
                        set thePath to POSIX path of theCurrentItem
                        repeat with theFile in folderContents
                                set theName to name of theFile
                                set cmd to "/Users/hiroki/bin/light-play " & atServer & " \"" & thePath & theName & "\""
                                --display dialog (cmd)
                                try
                                        do shell script (cmd)
                                on error
                                        exit repeat
                                end try
                        end repeat
                end tell
         
        end repeat
end open

アプリケーションで保存したものにフォルダーをドラッグ&ドロップします。

途中で止めるためのスクリプトも作ってみました。

ALStop
tell application "Finder"
        do shell script ("killall light-play")
end tell
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?