defcom maincom = main S I S;; defcom CaddHistory = addHistory S;; // correct url spaces fun correctUrl(s)= if ((strfindi "https://" s 0) != nil)||((strfindi "http://" s 0) != nil)||((strfindi "file://" s 0) != nil)||((strfind "ftp://" s 0) != nil) then ( let 0 -> pos in let " " -> from in let "%20" -> to in let strlen from -> fsize in let strlen to -> tsize in if ((fsize <= 0) || (tsize <= 0)) then s else while ((set pos = strfind from s pos) != nil) do set s = strcatn (substr s 0 pos)::to::(substr s (pos + fsize) ((strlen s) - pos))::nil; ) else nil; s;; fun main(name, r, s)= // add the url in voyager history _on _masterchannel CaddHistory [name]; _load "locked/lib/loc.pkg"; _load "locked/stduser1.pkg"; _script mkscript maincom [(correctUrl name) r s]; 0;;