2009年2月19日木曜日

ターミナル上からiTunesをアレコレ操作可能にする、iThief

iThiefは、ターミナル上からコマンドでiTunesを操作可能にするアプリケーションです。少し使ってみたところ、かなり面白かったので紹介してみようと思います。(ニーズがあるのか不明ですけどw)

「iThief、スゲー!」と思ったのは、単に曲を再生する、音量を変更する等の基本的な操作だけでなく、検索機能や各種書き換えを伴うような操作も可能なところです。ほんの一例を挙げてみると、キーワード検索して選曲する、今聴いている曲のレーティングやタグ付けする、新しいプレイリストを作成する、iTunesに曲をインポートする、などなど...。その他にも、アルバムアートや歌詞の検索なども手助けしてくれるコマンドが用意されています。


iThiefのオフィシャルサイトはコチラです。(コチラからダウンロードする事ができます)


以下、興味を持たれた方向けに備忘録的なメモを残しておこうと思います。

まず、インストール方法ですが、Macアプリケーションでよくある単純コピーではありません。以下、2ステップあります。
  1. 「iThief.scpt」ファイルを「~/Library/iTunes/Scripts/」以下にコピーします。(Scriptsフォルダが無い時は作成して下さい)
  2. 「ithief」ファイルを、パスが通った場所にコピーします。

この後、次のような書式でiTunesをアレコレ操作する事ができます。
$ ithief command option argument(s)
最初はお約束の「help」を実行してみると良いでしょう。
$ ithief help
個人的なお気に入りは、検索コマンド「se」(search)とランダムにアルバム単位で選んでくれるコマンド「ral」(ralbum)です。
$ ithief se 巡音ルカ
$ ithief ral
※検索キーワードは日本語もOK!

iThiefを利用する上での注意点は...
  • iTunesにtmp領域的な「iThief」というプレイリストが作成される
    →仕様です。
  • Web連携コマンドは、Python3.0で動作しない
    →どうやらWeb連携コマンドでは、内部的にPythonを利用しているようです。Python3.0が優先される環境ではエラーが出ました。OS標準のPytho2.5では正常に動作しました。

最後に、インストールするのは面倒だけど、具体的にどんな事ができるの?という方向けにコマンド一覧を載せておきます。コレを見て「おっ!」と思った方は試してみる価値があると思いますw

(参考:iThiefのコマンド)
  •  (i)nformation = Information about the current track.
  •  (p)lay = Play.
  •  (p)lay $$$$ = Play the playlist '$$$$'.
  •  (pt)rack $$$$ = Play the track $$$$ of the current playlist.
  •  (pa)use = Pause.
  •  (n)ext = Next track.
  •  (pr)evious = Previous track.
  •  (b)ack = Go to the beginning of the track or go to previous track if already at the start.
  •  (m)ute = Switch the mute status.
  •  (m)ute on|off = Set mute on or off.
  •  (s)top = Stop.
  •  (q)uit = Quit iTunes.
  •  (r)ate # = Set rating of current track to the given value [0-5].
  •  (re)veal = Show current track.
  •  (ra)ise = Bring itunes to the front.
  •  (v)olume up|down = Turn volume up or down.
  •  (v)olume # = Set volume to the given value [0-100].
  •  (f)ade = Fade out if iTunes is playing, fade in if it's paused.
  •  (f)ade # = Fade in or out to the given value [0-100].
  •  (rep)eat = Switch the repeat option among 'ALL', 'ONE' and 'OFF'.
  •  (rep)eat off|all|one = Set repeat.
  •  (sh)uffle = Switch the shuffle option betwween 'ON' and 'OFF'.
  •  (sh)uffle on|off = Set the shuffle option.
  •  (l)yrics = Show lyrics of the current playlist.
  •  (ls)tracks = List all tracks in the current playlist.
  •  (ls)tracks $$$$ = List all tracks that match '$$$$' in the current playlist.
  •  (lsp)laylists = List all available playlists.
  •  (lsp)laylists $$$$ = List all available playlists that match '$$$$'.
  •  (a)dd = Add current track to playlist 'iThief'.
  •  (a)dd $$$$ = Add current track to playlist '$$$$'.
  •  (se)arch $$$$ = Search tracks matching '$$$$', add them to the playlist 'iThief' and play them.
  •  (se)arch titles $$$$ = Search only in titles.
  •  (se)arch artists $$$$ = Search only in artists.
  •  (se)arch albums $$$$ = Search only in albums.
  •  (se)arch composers $$$$ = Search only in composers.
  •  (se)arch tags $$$$ = Search only in tags.
  •  (se)arch lyrics $$$$ = Search only in lyrics.
  •  (ran)dom # $$$$ = Play # random tracks from playlist $$$$. # and $$$$ are optional.
  •  (rar)tist = Play all tracks from a randomly chosen artist.
  •  (ral)bum = Play all tracks from a randomly chosen album.
  •  (rap)laylist = Play all tracks from a randomly chosen playlist.
  •  (adds)earch $$$$ = Same as 'search' but adds new found tracks to existing ones in playlist 'iThief'.
  •  (o)penstream $$$$ = Open stream with URL '$$$$'.
  •  (c)omment = Display comments of current track.
  •  (c)omment $$$$... = Add $$$$... to current comments.
  •  (t)ag = Display tags of current track.
  •  (t)ag show = Display tags of current track.
  •  (t)ag add $$$$ [$$$$...] = Add tag(s) $$$$ to current track.
  •  (t)ag del $$$$ [$$$$...] = Delete tag(s) $$$$ of current track.
  •  (im)port 'the/path/' = Import file(s) on 'the/path/'.
  •  (cp)playlist = Copy all the tracks from the current playlist into the playlist 'iThief'.
  •  (cp)playlist $$$$ = Copy all the tracks from the current playlist into the given playlist.
  •  (mk)playlist $$$$ = Create a new playlist with the given name.
  •  (w)eb (r)eference# = Search the web for the current track Replace # with a number.
  •  (w)eb (a)mazon = Search on Amazon for the current track.
  •  (w)eb (g)oogle = Search on Google for the current track.
  •  (w)eb (p)andora = Search on Pandora for the current track.
  •  (w)eb (i)tunes = Search on iTunes Store for the current track.
  •  (w)eb (w)ikipedia = Search on Wikipedia for the current track.
  •  (w)eb (amg) (s)ong = Search on All Music Guide for the title of the current track.
  •  (w)eb (amg) (a)rtist = Search on All Music Guide for the artist of the current track.
  •  (w)eb (amg) (al)bum = Search on All Music Guide for the album of the current track.
  •  (w)eb (c)ddb = Search on CDDB (Gracenote) for title of the current track, same options than allmusicguide.
  •  (w)eb (f)reedb = Search on FreeDB for info of the current track, same options than allmusicguide.
  •  (w)eb (ar)twork# = Search for artwork of current track on the web. Replace # with a number.
  •  (w)eb (googlei)mage = Search for artwork of current track on Google Image.
  •  (w)eb (al)lcdcovers = Search for artwork of current track on AllCDCovers.
  •  (w)eb (alb)umart = Search for artwork of current track on AlbumArt.
  •  (w)eb (co)verhunt = Search for artwork of current track on CoverHunt.
  •  (w)eb (m)ega-search = Search for artwork of current track on Mega-Search.
  •  (w)eb (cd)covers = Search for artwork of current track on CDCovers.
  •  (w)eb (s)eekacover = Search for artwork of current track on SeekACover.
  •  (w)eb (sl)eeveage = Search for artwork of current track on SleeveAge.
  •  (w)eb (l)yrics# = Search for lyrics on the web. Replace # with a number.
  •  (w)eb (googlel)yrics = Search for lyrics on Google.
  •  (w)eb (lyricsr)obot = Search for lyrics on LyricsRobot.
  •  (w)eb (lyricse)arch = Search for lyrics on LyricSearch.
  •  (w)eb (met)rolyrics = Search for lyrics on MetroLyrics.
  •  (h)elp = Display this help.
  •  (lic)ense = Display license.
  •  (ve)rsion = Display version and other info.
  •  (ins)tall = Display installation instructions.
※ここでは、iThief 1.2.1を利用しています。

0 件のコメント: