I have put E:\Documents\Pictures\Cloud Photos\Downloads as a Favorite in DOpus. The nice thing about Favorite is that I can named the folder whatever name I wanted. For this particular case, how can I match the Favorite name into the tab, because the tab currently shows (E:) Downloads (current folder name) and that can be confused with the actual Chrome Download folder E:\Downloads
Drop this script on to Preferences / Toolbars / Scripts and it will rename the tab when you are in that folder, regardless of how you enter the folder (doesn't have to be via the Favorite).
- SimpleTabRenamer.vbs.txt (1015 Bytes)
Script code for reference:
option explicit
' SimpleTabRenamer
' 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 = "SimpleTabRenamer"
initData.version = "1.0"
initData.copyright = ""
initData.url = "https://resource.dopus.com/t/make-tab-label-match-favorite-name/28999"
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 (afterFolderChangeData.tab.path = "E:\Documents\Pictures\Cloud Photos\Downloads") then
strName = "(%R) iCloud Photos"
end if
cmd.RunCommand("Go TABNAME=""" & strName & """")
end if
End Function
Excellent! Thank you, I downloaded the script and it works. Much appreciated!
The script seemed to cater to my specific case i.e. the exact file path matching a tab label.
How about if I need to match another file patch, say C:\Documents\Video, to a tab label My Videos, do I drop another .vbs script into Preference / Toolbars / Scripts ?
You want to have only one script of this type, else they will conflict with each other.
Instead of having two scripts, edit the script you have to cover any extra cases you need.
This is the part that you should edit:
if (afterFolderChangeData.tab.path = "E:\Documents\Pictures\Cloud Photos\Downloads") then
strName = "(%R) iCloud Photos"
end if
If you want to turn C:\Documents\Video
into My Videos
then change it to this:
if (afterFolderChangeData.tab.path = "E:\Documents\Pictures\Cloud Photos\Downloads") then
strName = "(%R) iCloud Photos"
elseif (afterFolderChangeData.tab.path = "C:\Documents\Video") then
strName = "(%R) My Videos"
end if
Brilliant... thank you soooo much!
@Leo
Your script appears to no longer works in Directory Opus 13.10.2 beta.
It works the first time Opus is opened and then reverts to the standard name when opening any other folder after that first time.
Try changing this line:
if (afterFolderChangeData.tab.path = "E:\Documents\Pictures\Cloud Photos\Downloads") then
To uppercase the two paths:
if (UCase(afterFolderChangeData.tab.path) = UCase("E:\Documents\Pictures\Cloud Photos\Downloads")) then
@Leo
Here is the new code I tried. Upon entering Opus it flashes the substitute text once for the tab and then reverts to the original default label for the tab:
if (UCase(afterFolderChangeData.tab.path) = UCase("C:\ProgramData\GPSoftware\Directory Opus")) then
strName = "(%R) Opus Config"
end if
Which other scripts do you have active? Any that handle the same OnAfterFolderChange event?
(The Scripts list will tell you which events each script handles.)
I had only one script that had that event:
That resolved the issue. I imagine I can only run one at a time since both change text in tabs. Is this so? Thanks for your help.