📌  相关文章
📜  操作运行 applescript 遇到错误:“查找程序出错:您无权在此处创建文件 - Go 编程语言 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:01.963000             🧑  作者: Mango

代码示例1
property theSavedValues : {"Mission Control", "Desktop", "Dashboard", "Launchpad"} -- for example

tell application "System Preferences"
    set current pane to pane id "com.apple.preference.expose"
    tell application "System Events"
        tell window "Mission Control" of process "System Preferences"
            click button "Hot Corners…"
            tell sheet 1
                tell group 1
                    set theCurrentValues to value of pop up buttons
                    if theCurrentValues is {"-", "-", "-", "-"} then
                        repeat with i from 1 to 4
                            set thisValue to item i of theSavedValues
                            tell pop up button i
                                click
                                click menu item thisValue of menu 1
                            end tell
                        end repeat
                    else
                        copy theCurrentValues to theSavedValues
                        repeat with i from 1 to 4
                            tell pop up button i
                                click
                                click last menu item of menu 1
                            end tell
                        end repeat
                    end if
                end tell
                click button "OK"
            end tell
        end tell
    end tell
    quit
end tell