美文网首页
AppleScript-指令

AppleScript-指令

作者: 不写昵称 | 来源:发表于2018-07-29 18:11 被阅读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  
    

    相关文章

      网友评论

          本文标题:AppleScript-指令

          本文链接:https://www.haomeiwen.com/subject/qohtvftx.html