Jump to content

Clear the Clipboard


This topic is 2918 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Little tip ...

It often happens that we wish to not allow pasting in a field.

It 's simple, just two steps of a script and the trigger OnObjectEnter

Set Selection [ Start Position:1 ]

Copy [ ]

Copyng an empty selection clears the clipboard.

Link to comment
Share on other sites

1) If the user is trying to do something not allowed, like enter a different value in a radio button field, I prefer to destroy their clipboard.

2) custom menu works with all the fields of the current layout... and sometimes we need to protect only one field.

Link to comment
Share on other sites

Keep in mind that it will clear a User's clipboard if they simply tab through the field. It might help to remove the field from tab order to offer some protection. Then it will only clear their clipboard if they pop the field. But it will ALWAYS clear the clipboard when the User pops the field even if User does not try to paste.

So although I like the concept, I will not switch methods. This is what I have been using to stop paste into a field defined with a value list. If there are flaws (or even downsides) to this technique, I would like to hear them as well.

UPDATE: File removed because I made a small change. Please see file below.

Link to comment
Share on other sites

What does this thread have to do with another thread and what one person might have wanted in another thread? Your opening post did not provide the benefits of your solution. If it was to protect from need to hard-code a value list then you should have said that.

We do not allow drag and drop in our solutions. I would rather hard-code the value list name (since it is a script parameter attached to the field it addresses) rather than destroy User clipboard simply because they legitimately pop the field.

I offered my opinion for other people reading this thread.

  • Like 2
Link to comment
Share on other sites

You explicity asked for flaws or downsides.

"We do not allow drag and drop in our solutions"

Even so, the user can drag&drop from another app to that field.

BTW: the tip for clear the clipboard didn't have anything in common with your example, but your example had many things in common with that other thread.

And, if we want to save the clipboard, we could by using Paste [ ] somewhere in the script.

Link to comment
Share on other sites

You explicity asked for flaws or downsides.

I did.

Even so, the user can drag&drop from another app to that field.

I was not aware of that, thank you.

BTW: the tip for clear the clipboard didn't have anything in common with your example

Well thank you. But your opening said, "It often happens that we wish to not allow pasting in a field."

Stopping pasting in a field sure seemed to be the subject to me - otherwise why wipe out a User clipboard? My example will work with any field. I used value list because that seemed like good example. What was problem with that?

And, if we want to save the clipboard, we could by using Paste [ ] somewhere in the script.

Of course but that wasn't in your approach either. I am glad you mentioned it.

Listen, Daniele, I told you I liked the concept but that does not mean I agree with your method nor do you have to agree with mine. I said, "I offered my opinion for other people reading this thread" because I wanted to be sure folks were aware that it could be a silent, tabbing, clipboard destroyer if they were unaware of it. That does not mean they shouldn't use your idea (they are big people and they make their own decisions) but I wanted to offer an alternative.

Many people post demos in Articles, Tips & Techniques only to have others post different points of view and their suggestions for a technique on same thread.

Anyway, the attached small change appears to resolve the issue of external application drag & drop, thanks for catching that. I believe the bottom line (for both of us) is sharing ideas and offering solutions to help people here. As we all know, there are many ways to accomplish same thing and each technique has its good and bad points. I will remove my prior file.

NoPasteMOD.zip

Link to comment
Share on other sites

dear LaRetta

with the premise that I have absolutely nothing against you and always appreciate tips, corrections and improvements, I appreciate your new tones and I hope that we continue on this road.

Link to comment
Share on other sites

  • 1 month later...
  • 4 years later...
  • Newbies

how do I use Copy "" in a script? I tried copy and pasting this into it and it won't paste. If I choose copy command I can't add "" to it. I tried a global field with ""in the data box to auto add but that doesn't clear it. instead it copies "" into the field. I tried auto add and empty data box. that didn't work either, funny thing is I know I did this before and it worked but I can't find the file I did it in.

 

 

 

 

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.