是否可以从仪表板小部件中创建新的小部件实例?
这是此问题的后续< /a>.
简单地保留已配置的仪表板小部件实例似乎是不可能的。 另一种方法是重新创建以前的实例。
是否可以从另一个小部件中创建新的仪表板小部件实例? 我还没有找到关于这个主题的任何内容。
This is a followup to this question.
It seems to be impossible to to simply keep already configured dashboard widget instances. An alternative way would be to recreate previous instances.
Is it possible to create new Dashboard widget instances from within another widget? I couldn't find anything about this topic, yet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是可能的,但我不知道如何。 交付状态小部件允许您打开其自身的新副本。 您可以在 中的屏幕截图中看到+号帮助图像。
It is possible, but I don't know how. The Delivery Status widget allows you to open a new copy of itself. You can see the + sign in the screenshot in the help image.
我对此表示怀疑......我认为这存在隐含的安全风险。
查看 Apple 的代码可能会为您提供最好的帮助。 当您“更新”小部件时,您会更改标识符,还是会自动擦除首选项? (请原谅我的无知 - 我远离我的 Mac,所以我无法调查自己)
不过,除此之外,您可能想要在“流程”或“苹果论坛。 电子邮件列表特别有用。
I would doubt it... I assume there's an implied security risk in that.
You'd probably be best served by looking through Apple's code. When you "update" a widget, do you change the identifier, or does it automatically wipe the preferences? (Pardon my ignorance- I'm away from my Mac, so I can't investigate myself)
Other than that, though, you'd probably want to look for "Dashboard Widget preferences wiped by update", either on 'flow or on the Apple forums. The email lists are particularly helpful.
AFAIK 以任何受支持的方式都是不可能的(Apple 的文档中没有提及,Dashboard 没有 AppleScript 字典)。
但是,由于 Widgets 可以访问文件系统并执行命令,因此可以对其进行破解:修改 com.apple.dashboard.plist 并使用 Killall Dock 重新启动 Dashboard (显然这不是优雅的解决方案)。
AFAIK it's not possible in any supported way (there's no mention of it in Apple's documentation, Dashboard doesn't have AppleScript dictionary).
However, since Widgets can have access to the filesystem and execute commands, it is possible to hack it: modify
com.apple.dashboard.plist
and restart Dashboard withkillall Dock
(obviously that's not elegant solution).我想也许您可以使用
widget.system
调用小部件包上的open
命令并打开一个新副本,所以我将 一个简单的小部件来测试它。 不去。不过,我想知道 Objective-C 插件是否会更强大,或者这是否是仪表板环境中的限制?
I thought perhaps you could use
widget.system
to call theopen
command on the widget bundle and open a new copy, so I put together a simple widget to test it out. No go.I wonder, though, if an Objective-C plugin would be any more capable or if this is a restriction baked into the Dashboard environment?
好吧,这对于早期版本的 OS X 来说是可能的。在我制作的小部件中,我使用以下代码创建了一个新实例:
但是现在,此代码重新安装了小部件。
Well, this was possible with an earlier version of OS X. In a widget I made I used the following code to create a new instance:
Now however, this code reinstalls the widget.
这不可能。 我之前也尝试过。
This is not possible. I had also tried it before.