set badURL to "ftp://server.com/path//toDir/toFile"
set AppleScript's text item delimiters to "//"
set badURL to badURL's text items
set AppleScript's text item delimiters to "/"
set goodURL to badURL's item 1 & "//" & rest of badURL as string
set AppleScript's text item delimiters to {""}
goodURL
Works perfect. I’ve put off learning this kind of code as I’ve always found text and string handling overly cryptic (don’t even talk about regexp). This, however, is clever enough it makes sense to me. Thanks again.
If there’s one thing to learn about handling text that you shouldn’t put off, it’s this (using text item delimiters). It’s one of the most powerful and overlooked tools available to scripters.