Hi Opus,
can you assist in remedying this problem ?
Thx, Brian
Error at line 86, position 2
Object required: 'clickData.func.sourcetab' (0x800a01a8)
Option Explicit
Function OnClick(ByRef clickData)
' This is the default example OnClick script, to help get you started.
' (You can use the "Default" menu above to replace this with your own default.)
'
' Some essentials (see Scripting Reference in the manual for the rest):
' - clickData.func.command:
' Command object.
' Preconfigured with source, destination and selected items.
' To change source/dest:
' cmd.SetSource, .SetSourceTab, .SetDest, .SetDestTab.
' To change files/folders acted upon:
' cmd.ClearFiles, .AddFile, .AddFilesFromFile, .RemoveFile, etc.
' To run a simple, single-line command:
' cmd.RunCommand "Help ABOUT"
' To run a multi-line command:
' cmd.Clear
' cmd.AddLine "Help ABOUT"
' cmd.AddLine "Help LICENCEMANAGER"
' cmd.Run
' - clickData.func.Dlg
' Dialog object for showing message boxes and other UI.
' Preconfigured with the source tab as its parent window.
' - clickData.func.sourcetab and .desttab:
' Source and destination folder tabs.
' Access to data such as:
' tab.selected, .selected_dirs, .selected_files.
' tab.all, .dirs, .files.
' tab.path (tab's folder path).
' tab.lister (top-level lister that contains the tab).
' tab.right (tells you if tab is on the left or right).
' etc.
' ---------------------------------------------------------
DOpus.ClearOutput
Dim cmd, lister, tab, selItem, folderEnum, folderItem
dim doCmd
' ---------------------------------------------------------
Set cmd = clickData.func.command
cmd.deselect = false ' Prevent automatic deselection
dim str_sourcePath
dim str_folder_driveLetter, str_remaining_folderPath
dim str_sharePoint_URL, str_Cmd
dim trace
trace = true
doCmd = true
str_sourcePath = clickData.func.sourcetab.path
str_folder_driveLetter = ucase(left(str_sourcePath, 1))
str_remaining_folderPath = mid( str_sourcePath, 3)
if trace then DOpus.Output "str_folder_driveLetter : " & str_folder_driveLetter
if trace then DOpus.Output "str_remaining_folderPath : " & str_remaining_folderPath
select case str_folder_driveLetter
case "R" : str_sharePoint_folderPath = "https://westernsydneyedu.sharepoint.com/:f:/r/sites/SolutionandProjectServices-Projects/Shared%20Documents/General/"
case "S" : str_sharePoint_folderPath = "https://westernsydneyedu.sharepoint.com/:f:/r/sites/SPSIntegrationandCapabilityTeam/Shared%20Documents/General/"
case "T" : str_sharePoint_folderPath = "https://westernsydneyedu.sharepoint.com/:f:/r/sites/2021TestingMaturationandConsultation/Shared%20Documents/General/"
case else :
doCmd = false ' goto unknownFolder_ie_notMapped_inSharepoint
end select
if doCmd then
str_sharePoint_URL = str_sharePoint_folderPath & str_remaining_folderPath
if trace then DOpus.Output "str_remaining_folderPath : " & str_remaining_folderPath
str_Cmd = DOpus.Vars.Get("opus_dopusrt") & " /runstd " & str_sharePoint_URL
cmd.RunCommand str_Cmd
' DOpus.Vars.Get("opus_dopusrt") /runstd str_sharePoint_URL
' {$glob:opus_dopusrt} /runstd str_sharePoint_URL
end if
' unknownFolder_ie_notMapped_inSharepoint: ' <<=== {sourcePath} is not mapped to sharepoint
' qq notify the user, TBD
End Function
Hi Leo,
thx, I tried that, but it didn't solve the problem.
In attempting to do that, and avoid vbScript problems,
I rewrote the script in JScript, the code is below.
However, retrieving clickData.func.sourcetab.path returns undefined,
so this I can't solve myself, could you please advise how to
resolve this ? The code follows.