setup-kit/osx/switchTopic.scpt

20 lines
547 B
AppleScript

on run argv
-- argv 是一个包含参数的列表
set action to item 1 of argv
if action is "dark" then
tell application "System Events"
tell appearance preferences
set dark mode to true
end tell
end tell
else if action is "light" then
tell application "System Events"
tell appearance preferences
set dark mode to false
end tell
end tell
else
display dialog "未知的参数: " & action
end if
end run