viewing paste uPaste Textual Addon | AppleScript

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
-- Unless otherwise noted the content of this AppleScript
-- file is Copyright © 2012, 2013 uPaste.me.
 
on textualcmd(id)
       
        if id is equal to "" then
                return "http://upaste.me/"
        else
                return "http://upaste.me/" & trim(id)
        end if
       
       
end textualcmd
 
on trim(id)
       
        repeat until id does not start with " "
                set id to text 2 thru -1 of id
        end repeat
       
        repeat until id does not end with " "
                set id to text 1 thru -2 of id
        end repeat
       
        return id
       
end trim
Viewed 437 times, submitted by Streusel.