【问题标题】:Running different Firefox Profiles in specific OS X Spaces在特定 OS X 空间中运行不同的 Firefox 配置文件
【发布时间】: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


    【解决方案1】:

    认为我有类似的问题。我想在空间上显示一个单独的 Firefox 窗口,但 afloat 和其他黑客对 Firefox 不起作用。所以我搞砸了一些工作,如果您有兴趣,请查看https://github.com/wader/firefox-all-spaces。最简单的可能是将整个 repos 下载为 zip 并按照说明进行操作。

    【讨论】:

    • 不错,但不是我想要的。这个想法是将特定空间与特定窗口联系起来。这个应用程序很接近,因为它可以创建一个独特的应用程序,该应用程序可以被视为绑定到特定窗口,并且可以调整以将其绑定到 Spaces & Expose 首选项中的特定空间,但只会创建 1 个特定于窗口的应用程序;我需要大约 7 个独特的空间特定应用程序:EV、Writing、Gaming、Productivity、Finance、Development 等。
    • 我猜你可以创建 7 个使用不同 Firefox 配置文件的独特应用。也许这就是你的意思?可以工作,但真的很乱,更不用说每次重新启动都必须调整空间首选项:(
    猜你喜欢
    • 2012-03-12
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    • 2011-11-20
    • 1970-01-01
    • 2020-07-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多