I think it would make sense to show tags in the metadata panel alphabetically sorted instead of showing them in the order they were written.
Well, i know some script, which can do that already, but it would make sense, if the metadata panel could do it natively.
They are listed alphabetically already - at least in English they are. Are they out of order in German?
Looks like they appear in the same order, as they were added.
They have never been shown sorted in the german version. They always appear in the order in which they have been written. I'm using the international version. Changing the language to english doesn't change the appearance of the tags.
english:
They look sorted to me, in general. Comment, Rating, Tags is alphabetical, as is Bewertung, Kommentar, Tags.
Perhaps there's a problem with accented characters though - Änderungsdatum should probably go before Attribute, I guess?
What I want to have sorted is the semikolon-separated string of tags. "app;zapp" instead of "zapp;app".
Ah ok, sorry I misunderstood.
We can probably add an option for this in the future.
Thanks for considering this.
For those who want to sort their tags right now here's a script button that sorts the tags of each selected file.
If you want to make it working for all files in the source folder change cmd.sourcetab.selected to cmd.sourcetab.all in line 7.
[code]Option Explicit
Dim cmd, file, item, itemData, tag, tagStrg, tmp
Function OnClick(data)
Set tmp = DOpus.Create.Vector
Set cmd = data.func.command
For Each file In cmd.sourcetab.selected
Set itemData = DOpus.FSUtil.GetMetadata(file)
For Each tag In itemData.tags
tmp.push_back tag
Next
tmp.sort
For Each item In tmp
tagStrg = tagStrg & item & ";"
Next
cmd.ClearFiles
cmd.AddFile file
cmd.RunCommand("SetAttr META ""tags:" & tagStrg & """")
tagStrg = ""
tmp.Clear
Next
End Function[/code]
Might be worth adding a before <> after check on the tag string so it skips files that are already sorted. Should speed things up when re-sorting lots of files.
You're right leo. Looking at the code I posted above I forgot to clear the temporary vector tmp which is much worse because it will create unwanted results. I edited my previous post and added the line tmp.Clear for safety reasons.
This version checks if the sorted string is fully equal to the original string and so avoids writing already existing, empty or "one tag" strings to the files:
[code]Option Explicit
Dim cmd, file, item, itemData, tag, tagStrg, tagString, tmp
Function OnClick(data)
Set tmp = DOpus.Create.Vector
Set cmd = data.func.command
For Each file In cmd.sourcetab.selected
Set itemData = DOpus.FSUtil.GetMetadata(file)
For Each tag In itemData.tags
tagString = tagString & tag & ";"
tmp.push_back tag
Next
tmp.sort
For Each item In tmp
tagStrg = tagStrg & item & ";"
Next
If tagStrg <> tagString Then
cmd.ClearFiles
cmd.AddFile file
cmd.RunCommand("SetAttr META ""tags:" & tagStrg & """")
End If
tagStrg = ""
tagString = ""
tmp.Clear
Next
End Function[/code]