Converting text

I have text that returns from a browser (look here for more info) and it returns something like this:

for spaces. I need Applescript to convert %20 into " " for me. Maybe also all other browser symbol “things.” Can this be done?

Hi,

You can use this small Python script and code like follows:


set txt to "/%7Econnolly/"
set toolpath to "Macintosh HD:Users:martin:Desktop:unquote.py"
set command to "/usr/bin/python " & quoted form of POSIX path of toolpath & " " & quoted form of txt
set output to do shell script command
-- returns "/~connolly/"

it’s also possible without external script


set a to "set%20a%20to%201"
do shell script "perl -e 'use URI::Escape; print uri_unescape(\"" & a & "\")';"
--> set a to 1

Thanks, guys.

Stefans script is the best. That solves my current problem. :smiley: