【发布时间】:2022-01-10 01:59:16
【问题描述】:
山脉脚本:
set doNotShowSplashScreen to (do shell script "defaults read com.apple.VoiceOverTraining doNotShowSplashScreen") as integer as boolean
on error
set doNotShowSplashScreen to false
end try
if doNotShowSplashScreen then
do shell script "/System/Library/CoreServices/VoiceOver.app/Contents/MacOS/VoiceOverStarter"
else
do shell script "defaults write com.apple.VoiceOverTraining doNotShowSplashScreen -bool true && /System/Library/CoreServices/VoiceOver.app/Contents/MacOS/VoiceOverStarter"
end if
其他 macOS 的脚本:
tell application id "com.apple.systemevents" to key code 96 using command down
【问题讨论】:
-
您检查您在哪个版本的 macOS 下运行,然后使用
ifstatement 运行 代码 基于版本。看看if Starements。您还可以使用 AppleScript 的例如system version of (system info)而不是 shell 命令sw_vers来获取版本。
标签: macos applescript