Re: Mac scripting: 淺談檔案夾動作
補充一個, 有人提到可以用 Automator
確實對不會寫程式的人而言, Automator 是救星
其實即使會寫 AppleScript, 我自己有時候也會用...
Automator 的動作雖然比較慢, 可是寫起來(根本不用寫)快超多, 而且不用 debug
Automator 怎麼和檔案夾動作連動呢?
以前面的例子...
建立一個這樣的流程
http://dl.getdropbox.com/u/207871/folder_action/automator-1.png

其中 originals 是我在 convert to JPG 資料夾裡建立的另一個資料夾
然後在檔案選單裡選擇「儲存為外掛模組」 (opt + cmd + s)
http://dl.getdropbox.com/u/207871/folder_action/automator-2.png

重點是第二行, 選擇外掛模組用:於檔案夾動作
第三行就附加到我們剛剛的那個檔案夾
這樣就行了, 照樣把檔案拖進去就能用, 也一樣會有備份
如果之後想刪掉, 這個檔案會在 ~/Library/Workflows/Applications/Folder Actions
http://dl.getdropbox.com/u/207871/folder_action/automator-3.png

如果我們打開「設定檔案夾動作」的視窗, 我們會發現有一個 scpt 檔被附加了
http://dl.getdropbox.com/u/207871/folder_action/automator-4.png

這個檔仍然在剛剛的 Folder Action Scripts 檔案夾裡, 打開來看看...
http://dl.getdropbox.com/u/207871/folder_action/automator-5.png

其實 Mac OS X 只是寫了幾行
然後自己用 Droplet 方式打開剛剛那個 Automator 程式而已嘛XD
不過這個的確不錯, 大家可以試試看囉
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.229.181.165
推
02/09 20:04, , 1F
02/09 20:04, 1F
→
02/09 20:15, , 2F
02/09 20:15, 2F
推
02/10 01:37, , 3F
02/10 01:37, 3F
→
02/16 22:49, , 4F
02/16 22:49, 4F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
16
22
MAC 近期熱門文章
13
34
PTT數位生活區 即時熱門文章