在特定的 OS X 空间中运行不同的 Firefox 配置文件
我想知道是否可以在 applescript 中创建一个脚本,其结果出现在特定的空格数 N 中。
我发现,由于我同时打开了许多 Firefox 窗口,所以让每组窗口都是自己的会很好身份并在特定的空间中开放。例如,1 上的社交网络和电子邮件、2 上的 VPN、3 上的 iTunes、5 上的在线视频、6 上的汽车研究等。
目前,我使用 AppleScript 将配置文件名称绑定到 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”配置文件并初始化该窗口以显示“我的音乐 Web”网站。
问题是,如何使其仅出现在 Space 7 中。
我尝试使用 Spaces 对话框,但是当我选择 AppleScript 可执行文件时,它只是显示为 FSlauncher,并且每个 AppleScript 都显示为 FSlauncher,所以我不能将它们分配到不同的空间。同样,如果我使用 Ned Deily 的例子:
在 OS X 10.5 或 10.6 中,空格 可以访问作业并 通过可编写脚本的界面进行更改 到系统事件.app:
告诉应用程序“系统事件” 将 x 设置为暴露首选项的空间首选项的应用程序绑定 将 x 设置为 {|com.apple.textedit|:4} & x -- 让 TextEdit 出现在空间 4 中 设置将首选项暴露给 x 的空间首选项的应用程序绑定 结束告诉如果你还不知道,
您可以从 Finder 获取应用程序的捆绑 ID:
告诉应用程序“Finder” 获取启动盘“Applications”文件夹中应用程序文件“TextEdit”的 ID 结束告诉
我发现所有脚本都带有 aplt 的 id,现在又用这种方法来区分!
还有其他人有想法吗?
谢谢!
I wonder if it is possible in applescript to create a script for which the results appear in a specific Spaces number, N.
I find since I have many Firefox windows opened at once, it would be nice to have each group of windows be its own identity and open up in a space specific for it. For instance, Social Networking and E-mail on 1, VPN on 2, iTunes on 3, on-line videos on 5, automotive research on 6, etc.
Currently, I use AppleScript to bind the Profile name to the Firefox invocation:
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/ &"
Here, I want to create a window for Space 7 that invokes the "Music Stuff" Profile and initializes the window to show the My Music Web website.
The problem is, how do I make this only appear in Space 7.
I tried using the Spaces dialog, but when I select my AppleScript executable, it just comes up as FSlauncher, and every AppleScript comes up as FSlauncher, so I can't assign them to different spaces. Likewise, if I used the example of Ned Deily:
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 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
I find that all scripts come up with an id of aplt, again with now way to differentiate!
Does anyone else have an idea?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我也有类似的问题。我想让一个单独的 Firefox 窗口在空间上可见,但是 afloat 和其他 hack 不起作用火狐。所以我搞砸了并得到了一些工作,看看 https://github.com/wader/如果您有兴趣,请使用 firefox-all-spaces。最简单的方法可能是将整个存储库下载为 zip 文件并按照说明进行操作。
Think i had a similar problem. I wanted to have a separate Firefox window visible on a spaces but afloat and other hacks don't work with Firefox. So i messed around and got something working, have a look att https://github.com/wader/firefox-all-spaces if your interested. Easiest is probably to download the whole repos as a zip and follow the instructions.