我怎样才能将窗口在OS X 10.8与AppleScript的目标空间? [英] How can I move a window to a target space with Applescript in OS X 10.8?

查看:304
本文介绍了我怎样才能将窗口在OS X 10.8与AppleScript的目标空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最后我想指定热键(通过阿尔弗雷德或Keymando),可以在最前面的应用程序移动到我的任何空间。触发一个AppleScript似乎成功的最可能途径。我看了看周围很多,似乎也曾经是一种通过在AppleScript的空间preferences要做到这一点,但这种消失了OS X Lion中。

Ultimately I'm trying to assign hotkeys (via Alfred or Keymando) that can move the frontmost application to any of my spaces. Triggering an applescript seems the most likely route to success. I've looked around a lot and it seems there used to be a way to do this via "spaces preferences" in applescript, but this disappeared in OS X Lion.

推荐答案

如果您纯净的AppleScript解决方案,你的运气之后是。

If you’re after a pure AppleScript solution you’re out of luck.

正如你所提到的空间preference窗格中消失了。此外,使命Control.app没有字典打开,并拉动窗口的属性(告诉应用程序查找为x设置到前面Finder窗口的属性)不显示任何东西涉及到空间。

As you mentioned the Spaces preference pane is gone. In addition, Mission Control.app has no dictionary to open, and pulling a window’s properties (tell application Finder to set x to the front finder window's properties) doesn't show anything that relates to Spaces.

系统事件的字典里有一个当前桌面属性,我不能争论,而且在任何情况下,被列为只读的。

System Events’s dictionary has a current desktop property that I can’t wrangle, and in any case is listed as read only.

然而,第一后的各空间和仪表板具有一个<一href=\"http://stackoverflow.com/questions/6768684/osx-lion-applescript-how-to-get-current-space-from-mission-control\">UUID包含在一个文件中的.plist(com.apple.spaces),你可以找到在〜/库/ preferences。在那的.plist有一个应用程序绑定部分,这表明你使用的行为能够通过Exposé功能/空间preference窗格没有完全消失访问是也。

However, each space after the first and the dashboard has a UUID that is contained in a .plist file (com.apple.spaces) that you can find in ~/Library/Preferences. In that .plist there is also an "app-bindings" section, which suggests that the behaviour you used to be able to access through the Exposé/Spaces preference pane is not totally gone.

不幸的是在我的测试中,我加入了字典和放大器;对字符串为应用程序绑定,我不能强迫一个应用到一个特定的空间,即使重新启动后。

Unfortunately in my testing, where I added a dict & string pair to "app-bindings", I couldn’t force an application to a particular space, even after a restart.

看来,当苹果抛弃了山狮的任务控制排空间网格,他们扔掉了用户控制哪些是出现在每个空间,顺便把交互已发生变化(特设额外的桌面与用户比较-defined网格),如果事情已经在幕后改变了我也不会感到惊讶了。

It appears that when Apple ditched the Spaces grid for Mountain Lion’s Mission Control row they threw away user control over what was to appear in each space, and by the way the interaction has changed (ad-hoc extra desktops compared with a user-defined grid) I wouldn’t be surprised if things have changed under the covers too.

这篇关于我怎样才能将窗口在OS X 10.8与AppleScript的目标空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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