我想知道是否可以(使用Xcode或任何其他开发工具)来制作一个可以在不发送键盘快捷键(Ctrl+左箭头或Ctrl+ctrl+右箭头)的情况下更改向右或左空间的应用程序。

问题描述 投票:0回答:1

#!/bin/sh # Enable Keyboard -> Shortcuts -> Mission Control -> Move left/right a space. /usr/libexec/PlistBuddy -c "Set :AppleSymbolicHotKeys:79:enabled true" ~/Library/Preferences/com.apple.symbolichotkeys.plist /usr/libexec/PlistBuddy -c "Set :AppleSymbolicHotKeys:81:enabled true" ~/Library/Preferences/com.apple.symbolichotkeys.plist # Ask the system to read the hotkey plist file and ignore the output. Likely updates an in-memory cache with the new plist values. defaults read com.apple.symbolichotkeys.plist > /dev/null # Run reactivateSettings to apply the updated settings. /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u # Move to right Space osascript -e 'tell application "System Events" to key code 123 using control down' # Disable Keyboard -> Shortcuts -> Mission Control -> Move left/right a space. /usr/libexec/PlistBuddy -c "Set :AppleSymbolicHotKeys:79:enabled false" ~/Library/Preferences/com.apple.symbolichotkeys.plist /usr/libexec/PlistBuddy -c "Set :AppleSymbolicHotKeys:81:enabled false" ~/Library/Preferences/com.apple.symbolichotkeys.plist # Ask the system to read the hotkey plist file and ignore the output. Likely updates an in-memory cache with the new plist values. defaults read com.apple.symbolichotkeys.plist > /dev/null # Run reactivateSettings to apply the updated settings. /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u

和rightspace.sh(相同的代码更改

key code 123

然后我测试了,请确保Apple脚本编辑器实用程序具有可访问性权限。然后,我禁用任务控制的关键捷径,然后进行了测试。它起作用的一个,我创建并应用了:
macos remote-desktop logitech mission-control
1个回答
0
投票

创建文件夹结构leftspace.app/contents/macos

将左Space.sh move到此文件夹

删除左Space.sh的扩展为左空间

to rightspace
做同样的

最后,我将这两个应用程序添加到访问权限时,就像以前使用Apple Script Editor一样。

	
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.