No internet connection
  1. Home
  2. How to

How to sort Soundminer columns

Asked by @Mark_Mangini in a separate thread, but that thread was more generic/wide.
Here's a more direct approach to sorting columns in Soundminer.

This requires some manual code, since Soundminer is not using the required macOS notarization service, which causes some UI picker functions to not work as intended.

function sortSoundminerColumn({ columnName }) {
    sf.ui.soundminer.appActivateMainWindow();

    var column = sf.ui.soundminer.mainWindow.scrollAreas.first.tables.first.childrenByRole('AXColumn').find(c => c.getString('AXIdentifier') === columnName);
    if (!column)
        throw `Couldn't find Soundminer column "${columnName}"`;

    column.mouseClickElement({
        relativePosition: {
            x: 10,
            y: -10,
        },
    });
}

sortSoundminerColumn({
    columnName: 'Description',
});
  • 15 replies
  1. I've now also added this as a template to the "Soundminer" package so it can be used without code :)

    Mark, see this webinar for more details on how to work with templates / presets:

    https://www.facebook.com/watch/live/?v=633065107406660

    1. In reply tochrscheuer:

      OH WOW. You just saved me from having to do all that preferences stuff I was working on earlier!! 😍

      1. M
        In reply tochrscheuer:
        Mark Mangini @Mark_Mangini
          2021-04-12 14:59:44.516Z

          I don't have the Soundminer Factory Presets in my left column nor can I search on it. How do I get this ACTION?

          1. MMark Mangini @Mark_Mangini
              2021-04-12 15:01:03.971Z

              never mind, I just downloaded it from the store. Thanks Christian!

            • M
              In reply tochrscheuer:
              Mark Mangini @Mark_Mangini
                2021-04-12 15:09:39.869Z

                Seems to be intermittent. I can trigger this command once and I get one sort. If I hit the button again, nothing happens. Sorting is a tricky thing with Soundminer depending on the state you last left it in. So, for example, I might have last left Soundminer in reverse Alpha sort. In this case, this trigger would put it in normal Alpha sort. But if I want to browse in multiple ways? Is there a way for this to continue to trigger the sort field each time I press the button that triggers this command? Currently, it won't do that.

                1. I set this up so that it simulates a mouse click on the sort column. That will toggle between ascending, descending and no sort.

                2. M
                  In reply tochrscheuer:
                  Mark Mangini @Mark_Mangini
                    2021-04-12 15:18:17.131Z

                    Also, can you make this an ACTION that is modifiable. As it happens, I want to sort on the TRACKYEAR column. Oddly, it is the only way to get SoundMiner to display results based on the "freshness" or newness of recording. Soundminer defaults to displaying files based on the date they were ingested or scanned thus insuring that the first results are the OLDEST sounds in your library. My solution has been to insure that every file in the database has a date of publication or recording in it and sorting on that to insure my returns always show the latest sounds recorded or added. I use the TRACKYEAR field for this and want to be able to sort on it. Is there any way to give us control over this command to choose the field to sort on? Thanks in advance.

                    1. M
                      In reply tochrscheuer:
                      Mark Mangini @Mark_Mangini
                        2021-04-17 17:22:50.073Z

                        The code posted above has the wrong X/Y coordinates but I cannot open the macro to change it. Should I remake the macro as a script from code, above, and reenter the X/Y coordinates?

                        1. Hi Mark,

                          You can always create a new script in SoundFlow (click "+ New" and choose "Script") and paste the above code in there and change the coordinates.

                          Note, that the coordinates were tested to work correctly on the newest builds of Soundminer v5Pro, so if you have a suspicion they're incorrect, it may mean that either your Soundminer setup is different from the ones we tested on, or that you're using it differently (say, trying to sort through a column that's not in view, or maybe you want it to work differently than it was designed).

                          Can you share a screen recording of how you're using it, and, even better, with a bug report (Script Help)?

                          This article + video describes how to best send us material to help you in various different scenarios:

                        2. M
                          In reply tochrscheuer:
                          Mark Mangini @Mark_Mangini
                            2021-04-18 17:10:51.626Z

                            How do I send you my screen capture showing how I am using it?

                            1. MMark Mangini @Mark_Mangini
                                2021-04-18 17:11:05.903Z

                                Do I post it here?

                              • M
                                In reply tochrscheuer:
                                Mark Mangini @Mark_Mangini
                                  2021-04-18 17:19:27.125Z

                                  I have entered a FEEDBACK/HELP response to this issue using the S.F. Help tool along with my logs

                                  1. M
                                    In reply tochrscheuer:
                                    Mark Mangini @Mark_Mangini
                                      2021-04-18 17:20:42.120Z

                                      What is the best way to send you a Screen Capture showing the issue as I am using it? This forum does not accept .mov files.

                                      1. Thanks for the email and the excellent videos! Make it very easy to look at it, appreciate it.

                                      2. In reply tochrscheuer:

                                        Hi Mark,

                                        I spoke to Justin from Soundminer and he integrated a solution so we can control this from SoundFlow :)

                                        This needs Soundminer prerelease version 5.0v687 - and version 1.1.3 of the Soundminer package in SoundFlow.
                                        It supports setting up to 2 columns for the sort order and whether it should be ascending or descending.

                                        Here, I'm setting it to sort just by a single column, Description, in ascending (A-Z) order: