Dragging URLs to Enhanced Applets


what UTI do I have to use so that an Enhanced Applet will accept urls dragged from the Safari address bar to the window?

I tried: public.url, public.file-url, public.url-name, public.utf8-plain-text, and public.plain-text

Any hints?

It doesn’t accept non-file URLs.

Any ideas instead of watching for changes in the clipboard to let a user add an url very comfortable to an Applet?

Not really, other than scripting Safari to get it that way.

You could set up an applet with a myriad tables dialog that says open. The user could then drag a URL into an empty row in the MT window and click OK (or cancel or edit it and then click OK).

(I set something like this up using text, not URLs, but it should work)

use script "Myriad Tables Lib" version "1.0.8"
use scripting additions
set blankTextList to {"", "", "", "", "", ""}
set TableReply to display table with data blankTextList ¬
	with title ¬
	"Drag-n-Drop" with prompt ¬
	"Drag text or URL into row" multiple selections allowed true ¬
	can add and delete true ¬
	editable columns {1} ¬
	column headings {"Text or URL"} ¬
	row numbering true ¬
	initially selected rows {1} ¬
	empty selection allowed true ¬
	row template {""} ¬
set enteredText to values returned of TableReply
set AppleScript's text item delimiters to {return}
set displayText to enteredText as text

set AppleScript's text item delimiters to {return & return}
set displayText to text items of displayText
set AppleScript's text item delimiters to {return}

display dialog displayText as text

Here’s the thing, though, you have to click in the field you want to drag and drop into in order for that to work, which is a bit crufty.

It’s possible that the very brilliant and helpful developer of Myriad Tables may see a value in tweaking it to allow an unselected or inactive field to accept a drag and drop input (if that’s even possible).