Script to get the name of the connected FTP site

I want to get the name from the address book for the current FTP site.

I found this command Properties FTPSITE which displays the dialog for the current site. So Dopus knows the current site, are the details available to a script?

My request is related to this post

I was able to get this from the path. Which is what @leo was doing in his regexp. So I was able to leverage that with some minor tweaks.