Do not, ever, use clipboard functions internally in scripts!
When you do that:
Use of the copy/paste clipboard functions is OK only as an explicit interface to the outside world (as in File>Create>From clipboard, or copying something to the clipboard because it will be used on some other program).
When you do that:
- You pollute the system clipboard with stuff the user has no use for
- You run the risk that the clipboard if overwritten by some other action between your copy and your paste.
Use of the copy/paste clipboard functions is OK only as an explicit interface to the outside world (as in File>Create>From clipboard, or copying something to the clipboard because it will be used on some other program).