如何以编程方式向任务控制添加空间? [英] How can I programmatically add a space to mission control?

查看:248
本文介绍了如何以编程方式向任务控制添加空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个新空间(也可以在以后删除它),而不必通过标准的misson控制gui。有什么方法来做这个程序吗?

I want to create a new space (and also be able to delete it later), without having to go through the standard misson control gui. Is there any way to do this programmatically? Either via terminal commands, applescript or some cocoa?

推荐答案

从GUI ...



...只是为了防止有人通过Google发现此内容

>任务控制 ...

It’s a cinch: when you’re in Mission Control...


  1. 将光标移动到屏幕右上角

  2. 点击从屏幕边缘滑出的新桌面选项卡。

注意:

delay 0.5 -- time to release command if the script is run with command-R
tell application "System Events"
    key code 126 using control down -- control-up
    delay 1
    do shell script "MouseTools -x 1900 -y 60;sleep 1;MouseTools -leftClickNoRelease;MouseTools -releaseMouse"
    key code 53 -- escape
end tell

这篇关于如何以编程方式向任务控制添加空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆