What I was trying to achieve was to copy selected lines in a custom window This line is one that was used in another script I have that did the same thing.