views:

208

answers:

5

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.

A: 

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.

Fat Lotus
A: 

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 with killall Dock (obviously that's not elegant solution).

porneL
A: 

Hi, Its not possible I had try it before also let me know if you get any solutions

A: 

I thought perhaps you could use widget.system to call the open 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?

Andrew Hedges
+1  A: 

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.

Colin Gislason
That's pretty interesting. They are creating instances like this: if (widget.system('open -b com.apple.dock ~/Library/Widgets/"Delivery Status.wdgt"',null).status) { widget.system('open -b com.apple.dock /Library/Widgets/"Delivery Status.wdgt"',null).status;}
Huxi