Make UUID & Strip

Hi folks.

I have a script that makes a UUID and sends it to the clipboard. Problem is that it has a trailing space, so I want to trim the thing. Here’s what I currently have:

do shell script "uuidgen | pbcopy"

What I would like to do is set that to a variable and trim/strip it, then copy it to the clipboard.

Anybody have any insight? I could use this in a lot of instances. All chatter appreciated.


Found the answer:

set myT to (do shell script "uuidgen")
set the clipboard to myT

For some reason it doesn’t have the trailing space.