I am a programmer and currently doing a lot of testing with code that hits FTP sites. In test, I am running Filezilla Server on my local machine to test before I hit customer FTP sites.
Here is my issue. I have multiple test users as if they are from different companies, each resolving to different locations on my test system. I hit each of them via FTP using LOCALHOST. I often open two or three of them and on Opus the tabs all say "localhost". I had been using Filezilla Client, where the tabs show "{connection name} - {user}@localhost". On Opus I know I can manually change a tab name, but if I close it and reopen it, the tab reverts.
I would like to find a way to have Opus show the "site name" on the tab? Showing the host address, when using "localhost" doesn't cut it.
Tabs can be manually renamed (or prefixed), or have their names changed via buttons (e.g. a button to go to a site and apply a prefix to the current tab at the same time).
For doing it automatically, something like this script may be what you want:
For a script to work, it would have to access the FTP setup information. If there is a script already available to perform this function, I'd be happy to try it.
Until then, this is what I am looking at, which is less than optimal:
The thing that's funny is once I open one of these tabs, I have no reference to which FTP site it is connected to. I see "localhost" and the contents. I think this warrants a feature request. Within either Settings / Preferences ... or within the site properties ... add something to allow for more descriptive tab names on FTP connection.
This script will rename a tab that came from an FTP address book entry to the name of the FTP entry. Not sure if it's exactly what you want but it should give you a starting point.
option explicit
' FTPSiteTabNamer
'
' This is a script for Directory Opus.
' See https://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.
' Called by Directory Opus to initialize the script
Function OnInit(initData)
initData.name = "FTPSiteTabNamer"
initData.version = "1.0"
initData.copyright = ""
' initData.url = "https://resource.dopus.com/viewforum.php?f=35"
initData.desc = ""
initData.default_enable = true
initData.min_version = "12.0"
End Function
' Called after a new folder is read in a tab
Function OnAfterFolderChange(afterFolderChangeData)
if afterFolderChangeData.result then
Dim cmd, strName
Set cmd = DOpus.Create.Command
cmd.SetSourceTab(afterFolderChangeData.tab)
if Left(afterFolderChangeData.tab.path, 11) = "ftp://SITE=" then
strName = """" & URLDecode(Mid(afterFolderChangeData.tab.path, 12, InStr(afterFolderChangeData.tab.path, "?") - 12)) & """"
end if
cmd.RunCommand("Go TABNAME " & strName)
end if
End Function
' from https://dwarf1711.blogspot.com/2007/10/vbscript-urldecode-function.html
Function URLDecode(ByVal str)
Dim intI, strChar, strRes
str = Replace(str, "+", " ")
For intI = 1 To Len(str)
strChar = Mid(str, intI, 1)
If strChar = "%" Then
If intI + 2 < Len(str) Then
strRes = strRes & Chr(CLng("&H" & Mid(str, intI+1, 2)))
intI = intI + 2
End If
Else
strRes = strRes & strChar
End If
Next
URLDecode = strRes
End Function