苹果文字;在 N 号空间打开应用程序 [英] Applescript; opening an app in Space number N
问题描述
我想知道是否可以在 applescript 中创建一个脚本,我们将应用程序名称和数字 N 作为输入,因此该应用程序在 Space 的空间编号 N 中打开.
I wonder if it is possible in applescript to create a script for which we give as input the application name and a number N, so this app gets opened in the Space's space number N.
我想用它来创建一个元苹果脚本,所以当计算机启动和登录后,在每个空间上我都会得到不同的应用程序,重要的是,我可以在脚本文件中更改它,而不是通过 mac os x空间偏好
I would like with this to create a meta-applescript, so when the computer boots and after login, on each space I get different apps, and important, I can change this in the script file, and not through mac os x Space's preferences
谢谢
推荐答案
在 OS X 10.5 或 10.6 中,Spaces
分配可以通过 System Events.app 的脚本化界面访问和更改代码>:
In OS X 10.5 or 10.6, Spaces
assignments can be accessed and changed via the scriptable interface to System Events.app
:
tell application "System Events"
set x to application bindings of spaces preferences of expose preferences
set x to {|com.apple.textedit|:4} & x -- Have TextEdit appear in space 4
set application bindings of spaces preferences of expose preferences to x
end tell
如果您还不知道,您可以从 Finder 中获取应用程序的 bundle id:
If you don't already know it, you can get the bundle id of an application from the Finder:
tell application "Finder"
get id of application file "TextEdit" of folder "Applications" of startup disk
end tell
这篇关于苹果文字;在 N 号空间打开应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!