Drag and drop a Bookmark
toeloop at swissonline.ch
Mon Feb 28 16:02:28 CST 2011
> Is this under Windows? Because on OSX I get the URL and not the title when
> dragging bookmarks from both Safari and Firefox into a Livecode field. In
> fact from memory, to get the title on a Mac you need to grab the url, load
> it and then parse the text between the title tags.
It's on Mac with the Opera browser. With Safari I get indeed the URL (?).
> on dragenter
> set the acceptdrop to true
> end dragenter
> on dragdrop
> put url (the dragData) into theHTML
> put offset("<title>",theHTML)+7 into b
> put offset("</title>",theHTML)-1 into z
> put char b to z of theHTML into me
> put cr & the dragData after me --the URL itself
> end dragdrop
That script works fine - with Safari. With Opera I get only the title.
On the other hand: when I drag the URL out of the browser (grabing it by the favicon) and drop it on the desktop, I get a file with the title as the filename (Safari) and the URL as the filename (Opera)???
By the way (LiveCode dictionary):
...The acceptDrop property is deprecated as of version 2.9. Setting the acceptDrop to true is equivalent to setting the dragAction to "copy".
I have to do more research tomorrow
More information about the use-livecode