Skip to content Skip to sidebar Skip to footer

Is It Possible To Create New Widget Instances From Within A Dashboard Widget?

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 ins

Solution 1:

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.

Solution 2:

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.

Solution 3:

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).

Solution 4:

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?

Solution 5:

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:

widget.system('/bin/sh -c "open `pwd`"', null);

Now however, this code reinstalls the widget.

Post a Comment for "Is It Possible To Create New Widget Instances From Within A Dashboard Widget?"