結局、QuickTime 6 Proを買った私。しかし、実は買う必要なかったみたいで。
フルスクリーンって、Pro版なくても実はできたのね! 今日気がつきました。
ま、気を取り直して。目的は来週の展覧会で、会場でMacで流すムービー。
さて、ちょっとしたAppleScriptソースを書いておきます。大したもんじゃないですが、以下GPLでよろしく。
*"Macintosh HD" 直下においた "test.mov"を、延々とフルスクリーンで流すものです。
無料のQuickTimeでもできると思います。(Proでしか試してないですけど)
tell application "QuickTime Player" activate open file "Macintosh HD:test.mov" set looping of movie "test.mov" to true present movie "test.mov" scale screen end tell --(C)Yuny,2004,http://d.hatena.ne.jp/Yuny/
いま、これを、時間が来たら流し、時間が来たら止めてマックをスリープさせるスクリプトを書いています。
展覧会会場でオートで流すためには必要ですね。その途中でできた派生プログラムを書いておきます。
*時刻を秒に計算(午前0:00からの数値)してクリップボードにコピーするもの。時間設定に使うために書きました。
tell application "Finder" activate repeat display dialog "時刻は何時ですか?(半角英数、24時間制)" default answer "8" set starthour to text returned of result starthour as number display dialog "時刻は何分ですか?(半角英数)" default answer "50" set startminute to text returned of result startminute as number display dialog "これでいいですか?(クリップボードにコピーします)" buttons {"訂正", "決定"} default button 2 set teisei to button returned of result if teisei is "決定" then exit repeat end repeat set x to (starthour * 3600) set y to (startminute * 60) set startsecond to (x + y) startsecond as string set the clipboard to result display dialog "クリップボードにコピーしました" end tell --(C)Yuny,2004,http://d.hatena.ne.jp/Yuny/
*時間が来たらスリープ。時間の秒数(52020)はご紹介したスクリプトで、午前0:00からの数値を算出。
tell application "Finder" set nowtime to 0 repeat until nowtime is 52020 set nowtime to time of (current date) nowtime as number if nowtime is 52020 then exit repeat end repeat sleep end tell --(C)Yuny,2004,http://d.hatena.ne.jp/Yuny/
*動画再生、時間が来たらスリープ。
tell application "Finder" set nowtime to 0 repeat until nowtime is 52020 set nowtime to time of (current date) nowtime as number if nowtime is 52020 then exit repeat tell application "QuickTime Player" activate open file "Macintosh HD:test.mov" set looping of movie "test.mov" to true present movie "test.mov" scale screen end tell end repeat sleep end tell --(C)Yuny,2004,http://d.hatena.ne.jp/Yuny/
*開始時間が来たら動画を再生して、終了時間が来たら再起動して、次の開始時間までFinderで待つ。
問題は、スリープ解除。ちょっと頭をひねってみました。
結局、画面のスリープだけでいいことにしました。定時になると再起動します。
(画面のスリープはシステム環境設定の省エネルギーで別途設定する)
定時は、この例では8:50にスタートし、18:10に終了するようにしています。
他の時間がいいときは最初の方の設定を直接書き換えます。
これで作ったアップルスクリプトアプリケーションをログイン項目に指定しておきます。
--画面のスリープだけ1分に指定しておく。 --自動ログインで、このアプレットと、QuickTimeのみ使用可能にしたユーザーを作っておく。 --DOCは隠しておく。 --保存で、アプリケーション、初期画面表示しない、自動的に終了しない。 tell application "Finder" set volume 3 --開始時間設定(start) set starthour to 8 set startmuniute to 50 set startsecond to (starthour * 3600 + startmuniute * 60) --終了時間設定(stop) set stophour to 18 set stopmuniute to 10 set stopsecond to (stophour * 3600 + stopmuniute * 60) repeat set nowtime to time of (current date) nowtime as number if nowtime is greater than or equal to startsecond and nowtime is less than stopsecond then exit repeat end repeat repeat set nowtime to time of (current date) nowtime as number if nowtime is greater than or equal to stopsecond or nowtime is less than startsecond then exit repeat tell application "QuickTime Player" activate open file "Macintosh HD:test.mov" set sound volume of movie "test.mov" to 30 set looping of movie "test.mov" to true present movie "test.mov" scale screen end tell end repeat restart end tell --(C)Yuny,2004,http://d.hatena.ne.jp/Yuny/
quicktimeを手動で止めるときはcomand+Qです。エラーメッセージは気にしないでください。
何とかできて良かったです。