-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathautoRecordScreen.applescript
executable file
·39 lines (36 loc) · 1.29 KB
/
autoRecordScreen.applescript
1
use AppleScript version "2.4" -- Yosemite (10.10) or lateruse scripting additions-- 隐藏tell application "System Events" to key code 4 using {option down, command down}-- 隐藏桌面图标do shell script "chflags -h hidden ~/Desktop/*"-- 自动隐藏和显示菜单栏tell application "System Preferences" to reveal the ¬ anchor named "main" of ¬ pane id "com.apple.preference.general"tell application "System Events" to tell ¬ process "System Preferences" to tell ¬ window "通用" to tell ¬ checkbox "自动隐藏和显示菜单栏" to ¬ perform action "AXPress"quit application "System Preferences"-- 开始录屏tell application "QuickTime Player" to activate (start (new screen recording))tell application "System Events" if application "QuickTime Player" is not (activate) then -- 显示桌面图标 do shell script "chflags -h nohidden ~/Desktop/*" -- 自动隐藏和显示菜单栏 tell application "System Preferences" to reveal the ¬ anchor named "main" of ¬ pane id "com.apple.preference.general" tell application "System Events" to tell ¬ process "System Preferences" to tell ¬ window "通用" to tell ¬ checkbox "自动隐藏和显示菜单栏" to ¬ perform action "AXPress" quit application "System Preferences" else return end ifend tell