jam*_*abb 6 macos applescript osx-lion
我正在尝试使OS X Lion中的停靠栏和菜单栏在全局范围内自动隐藏。我希望所有程序都这样做的原因是因为我正在尝试用酒玩游戏,并且在全屏模式下运行时,CPU占用率很高,因此在播放窗口时,我总是不得不手动告诉播放前先将其隐藏。
我知道有关编辑info.plist和LSUIPresentationMode项的信息,但是不幸的是,游戏启动器注意到文件已被编辑并在启动前对其进行了修复。因此,我唯一的选择是在启动之前将其隐藏在所有程序中,这可能吗?AppleScript甚至是解决此问题的最佳方法吗?我仍然在Mac上进行编码还很陌生,因此欢迎您提供任何有关实现此目标的建议。
您可以轻松进行坞站。我不知道如何全局执行菜单栏。我怀疑这是可能的。这是底座的脚本。它将根据当前条件将其切换为自动隐藏或不自动隐藏。祝好运。
tell application "System Events"
tell dock preferences to set autohide to not autohide
end tell
Run Code Online (Sandbox Code Playgroud)
小智 6
对于那些仍然感兴趣的人,这是一个适用于 OS X 的人的解决方案。“常规设置”页面现在从tab不起作用的搜索栏开始。这是一个变通方法。
tell application "System Preferences"
--open General Settings
activate
set the current pane to pane id "com.apple.preference.general"
try
--wait for screen to boot
repeat until window "General" exists
delay 0.2
end repeat
delay 0.5
on error error_message
get error_message
end try
end tell
--click the appropriate check box
tell application "System Events"
click checkbox "Automatically hide and show the menu bar" of window "General" of application process "System Preferences" of application "System Events"
end tell
Run Code Online (Sandbox Code Playgroud)
小智 5
对于大苏尔:
tell application "System Events"
tell dock preferences to set autohide menu bar to not autohide menu bar
end tell
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2895 次 |
| 最近记录: |