viewing paste youtube Textual Addon | AppleScript

Posted on the
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
-- 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://youtube.com/"
    else
        return "http://youtube.com/watch?v=" & 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 1103 times, submitted by Streusel.