【发布时间】:2011-07-05 16:58:50
【问题描述】:
我想知道是否可以在 applescript 中创建一个脚本,其结果出现在特定的空格编号 N 中。
我发现由于我同时打开了许多 Firefox 窗口,最好让每组窗口都有自己的身份并在特定的空间中打开。例如,社交网络和电子邮件 1,VPN 2,iTunes 3,在线视频 5,汽车研究 6,等等。
目前,我使用 AppleScript 将 Profile 名称绑定到 Firefox 调用:
do shell script "/Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P " & (ASCII character 34) & "Music Stuff" & (ASCII character 34) & " http://www.mymusicweb.com/ &"
在这里,我想为 Space 7 创建一个窗口,该窗口调用“Music Stuff”配置文件并初始化窗口以显示 My Music Web 网站。
问题是,我怎样才能让它只出现在 Space 7 中。
我尝试使用 Spaces 对话框,但是当我选择我的 AppleScript 可执行文件时,它只是以 FSlauncher 的形式出现,并且每个 AppleScript 都以 FSlauncher 的形式出现,因此我无法将它们分配给不同的空间.同样,如果我使用 Ned Deily 的例子:
在 OS X 10.5 或 10.6 中,空格 作业可以访问和 通过可编写脚本的界面进行更改 到系统事件.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 If you don't already know it,您可以从 Finder 中获取应用程序的捆绑包 ID:
tell application "Finder" get id of application file "TextEdit" of folder "Applications" of startup disk end tell
我发现所有脚本的 id 都是 aplt,现在又可以区分了!
还有其他人有想法吗?
谢谢!
【问题讨论】:
标签: macos firefox shell applescript osx-snow-leopard