2009年4月11日 星期六

My first automator + applescript

寫的過程中還把 automator 弄掛數次是怎樣啦 !

功能: XXX 檔案有開檔密碼, 密碼用某個規則放在某處 (don't ask me where). 用 automator + apple script 去把密碼抓到來開檔.

其中主要的 apple script 大概是這樣

on run {input, parameters}
repeat with f in input
set kf to balala # sorry, I can't tell you where I get the password !
tell application "Preview"
activate
open f
# activate
tell application "System Events"
keystroke kf
keystroke return
end tell
end tell
end repeat
return input
end run

參考 Orz

沒有留言: