bullettrain1433
V2EX  ›  macOS

无聊来调戏下 mac

  •  
  •   bullettrain1433 · Dec 14, 2014 · 6349 views
    This topic created in 4346 days ago, the information mentioned may be changed or developed.

    新建一个mac script,复制以下文本

    set currentUser to long user name of (get system info)
    set firstName to first word of currentUser
    set lastName to last word of currentUser
    set noteValues to {56, 56, 58, 56, 61, 60, 50, 56, 56, 58, 56, 63, 61, 50, 56, 56, 68, 65, 61, 60, 58, 50, 66, 66, 65, 61, 63, 61} -- F
    -- set noteValues to {65, 65, 67, 65, 70, 69, 60, 65, 65, 67, 65, 72, 70, 60, 65, 65, 77, 74, 70, 69, 67, 60, 75, 75, 74, 70, 72, 70} -- D
    -- set noteValues to {55, 55, 57, 55, 60, 59, 50, 55, 55, 57, 55, 62, 60, 50, 55, 55, 67, 64, 60, 59, 57, 50, 65, 65, 64, 60, 62, 60} -- E
    set syllables to {"hap", "p", "birth", "day", "to", "you", "[[slnc 500]]", "hap", "p", "birth", "day", "to", "you", "[[slnc 500]]", "hap", "p", "birth", "day", "dear", firstName, lastName, "[[slnc 500]]", "hap", "p", "birth", "day", "to", "you"}
    repeat with i from 1 to the length of noteValues
        set thisValue to item i of noteValues
        set thisSyllable to item i of syllables
        if length of thisSyllable is less than 3 then
            set speakingRate to 220
        else
            set speakingRate to 100
        end if
        say thisSyllable pitch thisValue using "Victoria" speaking rate speakingRate modulation 0
    end repeat
    

    运行下,哈哈,为你唱生日祝福

    37 replies  •  2014-12-16 01:09:22 +08:00
    icanfork
    icanfork
    Dec 14, 2014
    1
    楼下测试了有副作用吗?
    xuc
    xuc
    Dec 14, 2014
    2
    真的醉了
    Kabie
    Kabie
    Dec 14, 2014
    3
    ....这能有啥副作用。。。
    ivanlw
    ivanlw
    Dec 14, 2014 via iPhone
    4
    请问什么叫Mac script
    imn1
    imn1
    Dec 14, 2014
    5
    寻衅滋事
    sammo
    sammo
    Dec 14, 2014
    6
    @ivanlw 打开 /Applications/Utilities/AppleScript Editor.app (或者直接 Spotlight 搜 AppleScript 编辑器 ) ,把上面的 ``` ``` 之间的东西复制进去,点运行
    ivanlw
    ivanlw
    Dec 14, 2014
    7
    @sammo 谢谢……给自己的生日礼物~
    shangyingao
    shangyingao
    Dec 14, 2014
    8
    听着也是醉了:-)
    neoman
    neoman
    Dec 14, 2014
    9
    醉了
    qiuai
    qiuai
    Dec 14, 2014
    10
    一会试试
    hahastudio
    hahastudio
    Dec 14, 2014
    11
    hap, pi--
    46fo
    46fo
    Dec 14, 2014
    12
    我好像看懂了
    hasse
    hasse
    Dec 14, 2014
    13
    醉了~ 谢谢~
    twoyuan
    twoyuan
    Dec 14, 2014
    14
    哈哈 有意思
    en3073
    en3073
    Dec 14, 2014
    15
    醉了,23333333,谢谢,我也是觉得真有意思
    mcfog
    mcfog
    Dec 14, 2014
    16
    "p"改成“b”效果更好
    jaylong
    jaylong
    Dec 14, 2014
    17
    楼主的高亮代码是怎么发布的?
    Livid
    Livid
    MOD
    PRO
    Dec 14, 2014
    18
    iOct
    iOct
    Dec 14, 2014
    19
    醉了,呵呵……
    rayps
    rayps
    Dec 14, 2014
    20
    把代码中的 Victoria 换成 Alex 就变成男声了
    shao
    shao
    Dec 14, 2014
    21
    调戏得不错
    shiny
    shiny
    PRO
    Dec 14, 2014
    22
    一回想,只觉得像是鬼片里面那种风格……
    littlewey
    littlewey
    Dec 14, 2014
    23
    thanks!!
    bullettrain1433
    bullettrain1433
    OP
    Dec 14, 2014
    24
    @jaylong ```` ```` markdown语法
    17chai
    17chai
    Dec 14, 2014
    25
    周二生日,用上
    bullettrain1433
    bullettrain1433
    OP
    Dec 14, 2014
    26
    @17chai 哈哈,正好
    gaia
    gaia
    Dec 14, 2014
    27
    有才:)
    varrily
    varrily
    Dec 14, 2014
    28
    哈哈,有意思~~
    TankyWoo
    TankyWoo
    Dec 14, 2014
    29
    有意思,感谢
    konakona
    konakona
    Dec 15, 2014
    30
    @sammo 搜不到..
    XDA
    XDA
    Dec 15, 2014 via Android
    31
    注孤生!
    等会到公司放给我一个最近要过生日的同事听,哈哈
    rocai185
    rocai185
    Dec 15, 2014
    32
    给朋友听了,回复“写来这么多就那么两句简单的话!”
    jxdwinter
    jxdwinter
    Dec 15, 2014
    33
    哈哈哈,看懂了,有意思.
    ioth
    ioth
    Dec 15, 2014
    34
    mark
    scorpius
    scorpius
    Dec 15, 2014
    35
    有意思。
    clippit
    clippit
    Dec 15, 2014
    36
    为什么我突然想到 Portal 里 GLaDOS
    rudolf
    rudolf
    Dec 16, 2014
    37
    已醉。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1736 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 86ms · UTC 14:20 · PVG 22:20 · LAX 06:20 · JFK 09:20
    ♥ Do have faith in what you're doing.