Created
November 20, 2011 18:44
-
-
Save katsuma/1380680 to your computer and use it in GitHub Desktop.
rb-appscript testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'appscript' | |
include Appscript | |
its = app "iTunes.app" | |
# プレイリストの作成 | |
# playlist = its.make(:new => :user_playlist, :with_properties => {:name => "test"}) | |
# ファイルの追加(プレイリスト指定して追加) | |
#org_track = its.add(MacTypes::FileURL.path(File.expand_path("/path/to/foo.wav")), :to => playlist) | |
# ファイルの追加(ライブラリに追加) | |
org_track = its.add(MacTypes::FileURL.path(File.expand_path("/path/to/foo.wav"))) | |
# デフォルトの設定でwavをencode. 配列で返ってくるので注意 | |
current_track = org_track.convert.first | |
# 各項目の設定 | |
current_track.name.set "タイトル" | |
current_track.album.set "アルバム名" | |
curret_track.artist.set "アーティスト名" | |
# 元のwavを削除 | |
org_track.delete | |
# ダミープレイリストを削除 | |
playlist.delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment