【自動化】AppleScript 學習筆記
【自動化】AppleScript 學習筆記 輸出 簡單輸出 Code: "Hello~" Output: Result: "Hello" log Code: log "Hello" log 輸出的內容可在Messages Tab, Events Tab 或 Replies Tab中查看;Result Tab只會留存最後指定輸出的字串 Output: (*Hello~*) 簡單輸出的方法只會留存最後指定輸出的字串,而log 則不會有這樣的問題 變量 set Code: set num to 10 log num Output: (*10*) 控制 tell Code: tell application "Finder" -- 指定Finder -- code here end tell display dialog 顯示對話框 Code: display dialog "Hi" Output: say 播放語音 Code: say "Hello" if Code: set num to 100 if num > 99 then display dialog "Hi" end if Output: if…else set num to 10 if num > 99 then return "Hello" else return "Bye" end if Output: return 的內容顯示於Result tab "Hello" repeat Code: loop 10次 set num to 0 repeat until num = 10 set num to ( num + 1 ) log num end repeat Output: (*1*) (*2*) (*3*) (*4*) (*5*) (*6*) (*7*) (*8*) (...