為了收藏方便, 當然是全數從VCD光碟裡, 一一拷貝至Mac硬碟中.
但問題來囉, 數百集的小叮噹卡通, 要叫小朋友自己拖拉放至 QuickTime Player 中播放, 真的是非常煩瑣跟極度的不方便.
所幸, 無意中看到一個軟體 NicePlayer.
Nice Player
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-8c66ae7b3535b88c747ccee4d4e72a26.png)
這個軟體的特色是 AppleScript scriptable, 也就是說他留了個AppleEvent應用程式界面給 MacOS, MacOS可以利用這個界面對他進行進一步的溝通跟操控, 而且他的 PlayList 之內容也在操控的對象中.
靈機一動, 何不利用 Automator 跟 AppleScript 來操控 NicePlayer, 來達到自動播放小叮噹卡通的目的.
整個 Automator flow 分三部份
a) 取出所有小叮噹影集的檔案位置
b) AppleScript 程式碼1, 打亂小叮噹影集檔案位置的先後順序
c) AppleScript 程式碼2, 呼叫 NicePlayer, 請他以此打亂掉的小叮噹影集檔案當 playlist, 進行播放
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-1f4fb7148dad770eea2733d0c115afc7.png)
建立程序如下
1. 把 Automator 叫進來吧, 建立小叮噹影集的檔案位置
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-da0ce939c5ff48fae928ad9ac93368bf.png)
2. 加入兩個 AppleScript 元件
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-32fdc68edf2b0d18476bca1a41a900c8.png)
3. AppleScript 程式碼1, 打亂小叮噹影集檔案位置的先後順序.
AppleScript的語法設計的蠻像英語口語的, 即使沒學過, 應該大家都還是能看得懂吧.
程式做的事情很簡單, 從舊的 playlist 隨機取出一的檔案位置, 放入新的 playlist中. 同時再把此檔案位置從舊的 playlist 中刪除.
如此不斷重複, 就完成打亂的動作.
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-e90ab74c8267f12d014f5f0d3ce9e513.png)
4. AppleScript 程式碼2, 呼叫 NicePlayer, 請他以此打亂掉的小叮噹影集檔案當 playlist, 進行播放
這段是完全照 NicePlayer 的 AppleScript 範例一字不改的照抄. 當然, 前面傳送引數的第一行要動一下.
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-3115f7ba2fb57b9c8cff523a8cdbc8d2.png)
NicePlayer 範例
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-96dc0e992e652803324a2e3086ab0f1b.png)
5. 存成Automator應用程式, 方便點擊後立即執行
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-34a8d6eb30c3d870d5e4e90923ade710.png)
這樣就完成了, 只要一點擊, 源源不斷的小叮噹單元就被播放出來, 真是超方便. 家裡的小朋友很滿意哦!
![[分享]Automator和AppleScript跟NicePlayer的結合](http://attach.mobile01.com/attach/200906/mobile01-fae2f715b8f42e2b2c655e94c275fc00.png)
如法炮製, 湯姆貓, 小丸子... etc.




























































































