AppleScript POSIX path to smb path
You may need to URL Encode some characters and spaces, however, here is some example AppleScript code  that you may find helpful, although it only encodes spaces:
tell application &quot;Finder&quot; to ¬
    set theItem to the first item of ¬
        the (selection as alias list)

set posixForm to POSIX path of theItem

set {TID, AppleScript's text item delimiters} to ¬
    {AppleScript's text item delimiters, &quot; &quot;}
set foo to text items of posixForm
set AppleScript's text item delimiters to &quot;%20&quot;
set foo to foo as string
set AppleScript's text item delimiters to &quot;/&quot;
set foo to text items 3 thru -1 of foo
set foo to foo as string
set smbForm to &quot;smb://server/&quot; &amp; foo as string
set AppleScript's text item delimiters to TID

set the clipboard to smbForm


Notes:
Have a look at Encoding and Decoding Text in the Mac Automation Scripting Guide.


Note: The example AppleScript code is just that and sans any included error handling does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.