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
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
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
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
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
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