Drag and Drop from FireFox to TextField

I just saw one strange thing and I want to know - if possible - if it is my fault or…

I have a simple search window with a TextField whose text is selected.

Instead of Copy / Paste like I was doing since some minutes, I selected the text in FireFox, and drag it into the TextField to see that text inserted into the previous text (OS X, but I am able to run that application on Windows too).

My attended behavior was to only get the new (dropped) text.

The question is simple (!): is it my fault ?

firefox gets very strange behavior relating to copy-paste on a mac as I experimented …
may be it’s not your fault !

Thanks Jean-Yves.

Try copy an image (even a small one) and Paste it in a RTF document (from TextEdit)… You’d better Paste [New from Clipboard) in Preview, then Copy, then back in TextEdit: Paste *)

  • For strange reason, TextEdit refuse the Paste because of one of the resources in the Clipboard.

I don’t think FF has anything to do with that, as it’s about inserting the dragged text into a Xojo app.

BTW, if anyone wants to see what the clipboard contains - get this app of mine, which shows the clipboard using all 3 APIs (Scrap Mgr, Carbon Pasteboard and NSPasteboard):

You can also drag into the Carbon Pasteboard window to see what’s in a drag.

And to answer Emile’s question: I believe you expected that the selected text in the Xojo field gets replaced by the text you dragged into it, right? The answer is: That never happens on OSX, so the observed behavior is normal.

Thank you Thomas for your answer.

However, I never sw what you wrote above (excepted in Xojo IDE for example *).

BUT: it was lont time ago that I often used more applications than Firefox, TextEdit and my Xojo created application (with TEXT). So, I cannot really express fact, only opinion based on bad memory and expectation / surprise when something happens. If I’m surprised, it certainly is because this is new to me.

How do I (me, Emile Schwarz) what kind of data (and the data) there is in the Clipboard ? I use the Script Editor with:

return clipboard info

and I get (for example):

{{«class RTF », 1071}, {«class utf8», 21}, {«class ut16», 44}, {uniform styles, 440}, {string, 21}, {scrap styles, 62}, {Unicode text, 42}, {uniform styles, 440}, {scrap styles, 62}}

for the string return clipboard info copied from the Script Editor. Same kind of things apply when an image is in the Clipboard.

Why do I (Emile) use the Script Editor to do that (and some other simple things) ? Because the Script Editor application runs fast (loads fast), and because I use it since AppleScript was in beta (when I was working at Apple France), back in the early 1990.

Now, everyone is free to use the product he is fluent with and that product fills its needs.

  • Example:
    Select text in the Code Editor,
    Press-click the Option-Sift keys and click into an entry in the Navigation pane.
    The selected text stays and the name of the clicked object appears in the Code Editor.


I just make a simple test using TextEdit (from Apple) as the Drag and Drop Source into my very same application: the dropped text is inserted at the place I release the mouse !

Worst: a drag and drop between two windows using TextEdit (from Apple) have the same result.

OK: one more change that I have to leave with :frowning:

Sorry for the buzz.

BTW, using the Script editor to check the clipboard contents is not giving you all the infos. Many custom types have no “Scrap Type” code and won’t appear there. That’s what my app is for. Did you try it?

Thomas: No.

Just for understanding: since it is a custom type, how can you return useful information ?

Note: there are many years that I do not fall into a “Clipboard Custom Types” trap, so I do not recall. Usually, what AppleScript is enough for me to understand what I need.

Thomas: yes.
Nice report !


not as sexy as your application, but:

copy some rtf text in the Clipboard,
fire Script Editor,

return the clipboard as «class RTF »


return the clipboard as «class utf8» return the clipboard as «class PNGf»
and run.

of couse one have to learn to read hex :wink:

[quote=284046:@Emile Schwarz]Thomas: No.
Thomas: yes.[/quote]


I wrote my answer, then I had a fit of remorse, I downloaded your software and run it: nice.