escaping - How do I escape spaces in a path with Applescript? -


i've written script can link files , folders on server. problem string not escape spaces. can tell me how escape spaces '%20' ?

tell application "finder" set sel (the posix path of (the selection alias)) set sel ((characters 10 thru -1 of sel) string) set sel "afp://myserver._afpovertcp._tcp.local/" & sel set clipboard sel       end tell 

please thanks!

you can use text item delimiters find , replace characters

tell application "finder" set sel posix path of (the selection alias) set clipboard "afp://myserver._afpovertcp._tcp.local/" & (my findreplace(text 10 thru -1 of sel, " ", "%20"))  on findreplace(t, tofind, toreplace)     set {tid, text item delimiters} {text item delimiters, tofind}     set t text items of t     set text item delimiters toreplace     set t t text     set text item delimiters tid     return t end findreplace 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -