How to import Contributing artists Columns from file explorer

How can I import Contributing artists Columns from file explorer in to Directory Opus?

I have found an example here https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Adding_a_new_Column_from_Shell_Properties.htm

and I have found a post here: Quickly find shell property names
then I have add Steve button into my toolbar.
then I have search for contributing artist with this button


then copy the Raw Name and try to add the name in the example script without success.

Function OnInit(initData)
    initData.name = "Contributing artists Columns"
    initData.desc = "Adds Contributing artists Columns"
    initData.version = "1.0"
    initData.default_enable = true
    initData.min_version = "12.0.8"
    Dim props, prop, col
    Set props = DOpus.FSUtil.GetShellPropertyList("System.Music.Artist*", "r")
    for each prop in props
        Set col = initData.AddColumn
        col.name = prop.raw_name
        col.method = "System.Music.Artist"
        col.label = prop.display_name
        col.justify = "left"
        col.autogroup = true
        col.userdata = prop.pkey

    next
End Function
Function System.Music.Artist(scriptColData)

    scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)

End Function

Please help me, what should I changed?

The line that the script editor is telling you has an error would be the best place to start.

Try removing the dots from your function name.

after removed the dots from function name, there is no error. but nothing happen when I run this command or click on this button, actually I don't have any idea where should I found the column in directory opus, such as I see in the other sections in the column menu but there is no Contributing artists

Columns added by scripts will usually be in the Scripts category, not the Other category.

After clicking on that button I have checked my Script category also but no Column has been added at all

Don't put the script in a button, save it as a text file to /scripts.

Did you remove the dots from

col.method = "System.Music.Artist"

as well?

hi lxp Now I have the Contribution artist column in script category. But the Problem is that the value of this column does not show in DOpus File Display

here is my Current code:

option explicit

' Contributing artists Columns
' (c) 2022 Khalid

' 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 = "Contributing artists Columns"
	initData.version = "1.0"
	initData.copyright = "(c) 2022 Khalid"
'	initData.url = "https://resource.dopus.com/c/buttons-scripts/16"
	initData.desc = "Adds Contributing artists Columns"
	initData.default_enable = true
	initData.min_version = "12.0"
	Dim props, prop, col
    Set props = DOpus.FSUtil.GetShellPropertyList("System.Music.Artist*", "r")
    for each prop in props
        Set col = initData.AddColumn
        col.name = prop.raw_name
        col.method = "SystemMusicArtist"
        col.label = prop.display_name
        col.justify = "left"
        col.autogroup = true
        col.userdata = prop.pkey

    next
End Function
Function SystemMusicArtist(scriptColData)

    scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)

End Function


But Look at this no value has been shown in my file display in DOpus

The same folder in file explorer has been displayed this value in Contributing artists Column

At least from the screenshots, the information you want is already in the Artists column in Opus?

but for some wav file opus does not support the tag where file explorer does. this is why i need to import this column, so please tell me what did i miss in my script code?

It's because that shell property returns a list of artist names, not just one name.

The other column (Contributing Artists Sort) doesn't seem to do anything either, so I took out the property name wildcard and made it only add one column.

option explicit

Function OnInit(initData)
	initData.name = "Contributing Artists Column"
	initData.version = "1.0"
	initData.copyright = "(c) 2022 Khalid"
	initData.url = "https://resource.dopus.com/t/how-to-import-contributing-artists-columns-from-file-explorer/40525/"
	initData.desc = "Adds Contributing Artists Column"
	initData.default_enable = true
	initData.min_version = "12.0"

	Dim props, prop, col
	Set props = DOpus.FSUtil.GetShellPropertyList("System.Music.Artist", "r")
	If (props.count = 1) Then
		Set prop = props(0)
		Set col = initData.AddColumn()
		col.name = prop.raw_name
		col.method = "SystemMusicArtist"
		col.label = prop.display_name
		col.justify = "left"
		col.autogroup = true
		col.userdata = prop.pkey
		col.type = "string"
	End If
End Function

Function SystemMusicArtist(scriptColData)

	Dim artists, artist, s
	
	If (IsEmpty(scriptColData.item.shellprop(scriptColData.userdata))) Then
		Exit Function
	End If
	
	Set artists = scriptColData.item.shellprop(scriptColData.userdata)

	s = ""
	For Each artist In artists
		If (s = "") Then
			s = artist
		Else
			s = s & ", " & artist
		End If
	Next
	scriptColData.value = s

End Function
1 Like

A much larger question is why doesn't OPUS simply add "contributing artist" to the list of format options without having its customers who are simply not interested in*n scripting because we have more important matters in our lives?

A very good question indeed!