Dropping raw text on dock icon

I know how to accept and open files dropped onto the app icon, but is there a way to accept raw text dropped onto an icon like SimpleText does?

i.e. when you drag a paragraph from a webpage in Safari onto SimpleText in the dock, it opens a new plain text document that contains the text you dropped onto its icon.

And what about AcceptTextDrop ?
Do you accept them ?

@Mark Sweeney — I have spent a few hours trying to figure this out and it seems to be MUCH MORE complicated that I expected!

I don’t have time now to continue searching but please give us the solution if you can find it.

[quote=463080:@Emile Schwarz]And what about AcceptTextDrop ?
Do you accept them ?[/quote]
Windows and Controls can have AcceptTextDrop, but not Application, which is where I’m assuming you’d have to deal with something being dropped on the application icon.

TextEdit is open source, you could see how it’s done.

Yes, Mark, I noticed that later, but I was not able to change it, sorry.

I have fired Xojo, checked the LR and found what you wrote, unfortunately.

It looks like the easiest way is to register your app as a service:
see: https://stackoverflow.com/questions/27420016/osx-drag-and-drop-text-not-file-to-app-dock-icon
or: https://lethain.com/cocoa-drag-and-drop-text-into-the-dock-icon/

Both are in foreign programming languages. However, translating to Xojo shouldn’t be too hard (I don’t have time right now; if you don’t get other answers, I’ll try later).
If you’re using the MBS plugin, there are ready-classes to deal with services. Otherwise, declares will be the way to go.

Thank you!

That gives me something to work from.

[quote=463304:@Mark Sweeney]Thank you!

That gives me something to work from.[/quote]
You’re welcome.