[MacRuby-devel] NSWorkspace.sharedWorkspace.recycleURLs:completionHandler doing nothing under macruby

Caio Chassot lists at caiochassot.com
Tue Aug 2 04:55:25 PDT 2011


On Tue, Aug 2, 2011 at 04:26, Terry Moore <tvmoore at mac.com> wrote:
> Sounds like an asynchronous issue. Try adding a completion selector and calling nsrunloop.

Tried both, no dice.

@jacknutting mostly nails it:

> core problem is that AppKit classes are really meant for use in a full app (w/ GUI). Foundation OK in scripts. NSFileManager?

(https://twitter.com/jacknutting/status/98353849055715330)

The length of the page here leads me to believe cocoa sucks at trashing:
http://www.cocoadev.com/index.pl?MoveToTrash

The icing on the cake is that this is likely dead simple to do with…
wait for it… AppleScript. Well, rb-appscript anyway. Or
ScriptingBridge and the Finder.

I'd `mv $@ ~/.Trash`, but "Trash is complicated. Handles name clashes,
different behaviour for mounted volumes, restores to original
location."
(https://twitter.com/kch/status/98359569553690624)

So, well… `rm -rf`. :/


More information about the MacRuby-devel mailing list