This AppleScript saves the URL locations (local and remote) of all the documents in a single window.
tell application "TextWrangler"
set alldocs to every text document of text window 1
set allfiles to {}
set str to ""
repeat with adoc in alldocs
if is FTP of adoc then
set ftpinfo to FTP Info of adoc
set murl to URL of ftpinfo
else
set murl to URL of adoc
end if
set end of allfiles to murl
set str to str & "||" & murl
end repeat
set filename to (choose file name default name "TextWrangler Docs.txt")
set saver to make new text document
open saver opening in new_window
set text of saver to "--docsaver do not edit this line" & str
save saver to filename
close saver
end tellThis next script is for opening up the above-created file, and restoring all your files into a single window. If any of the files are remote, then the script will sense that and ask you for your password to that server. Obviously if the file set is on two different servers, then the one password won't work (unless they are the same password!). If the password is wrong, then TextWrangler will just give you a password window for each file. The only problem is that when you type in your password, it doesn't show the dots so you can read your password right there. So just be careful.
tell application "TextWrangler"
set filename to (choose file)
open filename opening in new_window
set allfilesstr to text of text document 1
close text document 1
set allfiles to rest of my splitit(allfilesstr, "||")
set hasFTP to false
repeat with afile in allfiles
if afile contains "ftp" then
set hasFTP to true
end if
end repeat
set ps to ""
if hasFTP then
set ps to text returned of (display dialog "Type your password of the server your files are on" default answer "")
end if
if length of allfiles is greater than 0 then
set afile to item 1 of allfiles
set afile to my snr(afile, ":@", (":" & ps & "@"))
open location afile
end if
set allfiles to rest of allfiles
repeat with afile in allfiles
set afile to my snr(afile, ":@", (":" & ps & "@"))
open location afile
end repeat
end tell
on snr(the_string, search_string, replace_string)
tell (a reference to my text item delimiters)
set {old_tid, contents} to {contents, search_string}
set {the_string, contents} to {the_string's text items, replace_string}
set {the_string, contents} to {the_string as Unicode text, old_tid}
end tell
return the_string
end snr
on splitit(the_string, search_string)
tell (a reference to my text item delimiters)
set {old_tid, contents} to {contents, search_string}
set {arr, contents} to {the_string's text items, old_tid}
end tell
return arr
end splitit
This AppleScript features a search (or find) and replace function as well as a string splitter that creates a list out of a string that is split by a specified string.
[robg adds: I haven't tested these scripts.]

