AppleScript-指令

2018-07-29  本文已影响0人  不写昵称

say
作用:让计算机发声

say "good morning,Mr. Li" using "Fred" -- using用于指定用谁的嗓音
say "good morning,Mr.Huang.how are you"
say "I'm fine,thanks.how about you ?"
say "I'm fine,too"

beep
作用:让计算机发出‘咚’的声音。

beep 3 --发出3声'咚'的声音

tell
作用:将特定的任务交付给Mac中特定的程序去执行
语法:

tell application "应用名"   --此处的双引号不能少
执行的任务
end tell  

举例:
让Finder程序清空垃圾桶

tell application "Finder"  
    empty the trash  
    beep  
    open the startup disk  
end tell  
上一篇下一篇

猜你喜欢

热点阅读