I googled for HTMLify Applescript, wanting to find out some simple code for how to escape the text in an AppleScript string, so I can pass it as arguments to a URL.
My site came up with the top link. I was hoping for a better solution to the one I had come up with!
Here is the code that I used in the Post Trackback AppleScript:
property allowed_URL_chars : (characters of "$-_.+!*(),1234567890abcdefghijklmnopqrstuvwxyz") property hex_list : (characters of "0123456789ABCDEF") on encode_URL_string(this_item) set character_list to (characters of this_item) repeat with i from 1 to number of items in character_list set this_char to item i of character_list if this_char is not in allowed_URL_chars then set item i of character_list to my encode_URL_char(this_char) end repeat return character_list as string end encode_URL_string on encode_URL_char(this_char) set ASCII_num to (ASCII number this_char) set x to item ((ASCII_num div 16) + 1) of hex_list set y to item ((ASCII_num mod 16) + 1) of hex_list return ("%" & x & y) as string end encode_URL_char11 hours, 37 minutes after the fact.
Thanks, this looks pretty good. However, I’m not sure it works completely - it seems to skip spaces, when it should be turning them into a + sign.
18 hours, 44 minutes after the fact.