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?

iTunesのアルバムをコピー

Last updated at Posted at 2025-07-19

ALACが再生できるようになったので、Mac mini G4(Mac OS X 10.5)のiTunesに入れてあるファイルをNetBSD/evbarm(armv6 c1k)にコピーする方法を作ってみました。

AppleScriptで作りました。

copy alubm
tell application "iTunes"
        set cal to item 1 of selection
        set floc to (location of cal)
        tell application "Finder"
                set fol to floc's folder as alias
                set dir to POSIX path of fol
                set dpath to characters 1 thru -2 of dir as string
                set cmd to ("scp -r \"" & dpath & "\" 10.0.1.41:itunes/ > /dev/null 2>&1 &")
                --display dialog cmd
                do shell script cmd
        end tell
end tell

久しぶりのAppleScriptなので、ぐでぐでです。

iTunesはアーティスト名、アルバム名の二階層でフォルダーを作りますが、アルバム名だけでコピーしています。おそらくぶつかる事はないと思います。

アーティスト名はゆれが激しくて、あまりあてになりません。

非同期でscpしていて、何時終っているかわからないのがちょっといけてないです。

これをライブラリ:iTunes:Scriptsの下に入れて、アルバムを選択して実行します。

itas.png

NetBSDのストレージは小さいので、ききたいアルバムだけコピーす事とします。

実はこの方法を思いつくまでMidnight Commander(mc)やnnnを使うことを考えましたが、mcはpkg-configがなくconfigureが通らずnnnはgmakeでビルドできずであきらめました。

以前は日本語を削除してコピーする方法を考えましたが、UTF8なのでそのままコピーすることにしました。

HFSでは/をファイル名に使えますが、私のiTunesのライブラリの中には/を使ったファイル名はありませんでした。

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?