Jump to content




Clear the Clipboard



  • Please log in to reply
10 replies to this topic

#1 OFFLINE   Raybaudi  ChindoguMaker

Raybaudi
  • Members
  • 3,005 posts
  • LocationRome, Italy
  • FM Client:11 Advance
  • Platform:Windows XP
  • Skill Level:Intermediate
  • Time Online: 19d 23h 30m 43s

Posted 30 December 2011 - 01:06 PM

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.
Daniele
--------------------------------
I'm sorry for my English

#2 OFFLINE   Karsten Wolf  member

Karsten Wolf
  • Members
  • 24 posts
  • LocationGermany
  • FM Client:10 Advance
  • Platform:Max OS X Tiger
  • Skill Level:Intermediate
  • Time Online: 1d 5h 58m 13s

Posted 30 December 2011 - 05:12 PM

Destroying the user's clipboard is a bad idea in my opinion.

I think it would be better to use a custom menu with the "Paste" menu item deleted.

#3 OFFLINE   Raybaudi  ChindoguMaker

Raybaudi
  • Members
  • 3,005 posts
  • LocationRome, Italy
  • FM Client:11 Advance
  • Platform:Windows XP
  • Skill Level:Intermediate
  • Time Online: 19d 23h 30m 43s

Posted 31 December 2011 - 12:31 AM

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.
Daniele
--------------------------------
I'm sorry for my English

#4 OFFLINE   Rick Whitelaw  Time Saver

Rick Whitelaw
  • Members
  • 117 posts
  • LocationToronto, Canada
  • FM Client:11 Advance
  • Platform:Mac OS X Lion
  • Skill Level:Intermediate
  • Time Online: 4d 14h 11m 44s

Posted 01 January 2012 - 05:26 PM

I like this tip. It's probably the only time the word "copy" would appear in a script of mine!

RW.

#5 OFFLINE   LaRetta   Lifetime Student

LaRetta
  • Members
  • 8,061 posts
  • LocationOregon
  • Time Online: 57d 23h 32m 6s

Posted 02 January 2012 - 09:11 AM

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.
Each assumption is an educated guess, a likely condition or event, presumed known and true in the absence of absolute certainty.

#6 OFFLINE   Raybaudi  ChindoguMaker

Raybaudi
  • Members
  • 3,005 posts
  • LocationRome, Italy
  • FM Client:11 Advance
  • Platform:Windows XP
  • Skill Level:Intermediate
  • Time Online: 19d 23h 30m 43s

Posted 02 January 2012 - 10:39 AM

1) Show text2
2) Enter something into it
3) Drag from text2 to text

BTW: you have hard-coded the ValueList name and this was exactly what DJ didn't want.
http://fmforums.com/...post__p__379461
Then it was simpler to validate by value of a value list.
Daniele
--------------------------------
I'm sorry for my English

#7 OFFLINE   LaRetta   Lifetime Student

LaRetta
  • Members
  • 8,061 posts
  • LocationOregon
  • Time Online: 57d 23h 32m 6s

Posted 02 January 2012 - 10:54 AM

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.
Each assumption is an educated guess, a likely condition or event, presumed known and true in the absence of absolute certainty.

#8 OFFLINE   Raybaudi  ChindoguMaker

Raybaudi
  • Members
  • 3,005 posts
  • LocationRome, Italy
  • FM Client:11 Advance
  • Platform:Windows XP
  • Skill Level:Intermediate
  • Time Online: 19d 23h 30m 43s

Posted 02 January 2012 - 11:48 AM

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.
Daniele
--------------------------------
I'm sorry for my English

#9 OFFLINE   LaRetta   Lifetime Student

LaRetta
  • Members
  • 8,061 posts
  • LocationOregon
  • Time Online: 57d 23h 32m 6s

Posted 02 January 2012 - 08:14 PM

View PostRaybaudi, on 02 January 2012 - 11:48 AM, said:

You explicity asked for flaws or downsides.
I did.

Quote

Even so, the user can drag&drop from another app to that field.
I was not aware of that, thank you.

Quote

  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?

Quote

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.

Attached Files


Each assumption is an educated guess, a likely condition or event, presumed known and true in the absence of absolute certainty.

#10 OFFLINE   Raybaudi  ChindoguMaker

Raybaudi
  • Members
  • 3,005 posts
  • LocationRome, Italy
  • FM Client:11 Advance
  • Platform:Windows XP
  • Skill Level:Intermediate
  • Time Online: 19d 23h 30m 43s

Posted 03 January 2012 - 01:06 AM

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.
Daniele
--------------------------------
I'm sorry for my English

#11 OFFLINE   Hyperscripter  newbie

Hyperscripter
  • Members
  • PipPipPipPipPip
  • 5 posts
  • FM Client:6
  • Platform:Mac OS X Snow Leopard
  • Skill Level:Novice
  • Time Online: 3h 52m 51s

Posted 22 February 2012 - 08:47 AM

I like the idea of this solution, unfortunately I am using FM 6, which does not have a 'set selection' command. Would you have any idea, how I would go about doing this with the commands that I have available in FM 6 ?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

FMForum Advertisers