Introducing macros for searching labels; what the Label Editor should do

This note shows a couple of heavily used macros I wrote in Keyboard Macro (OSX).
I use them a LOT.
The goal is:
Search my labels for a string, and go to that location on the timeline.
The problem is:
Opening the “Label Editor”, there is no search capability.

My Nyquist skill is pretty weak. Keyboard Macro is very easy to use.

Here are sketches for how they work.
If there is interest in using them,
I will edit this and add links to the exported KM macro files (XML)
for you to import.
=-=-=-=-=-=-=-

Here is the first one:

“Store Cursor, Export labels”

Triggered by any of the following:

  • [image]The Hot Key ⌃⌥⌘B is pressed

Will execute the following actions:

  • [image]Comment “NOTE on the output file”
    The file name is time stamped, and you can change it before saving.
    After that, this macro does not open the file for you.
    Open the labels file manually in textedit from Finder.
  • [image]Select Menu Item in Audacity
    Select: Select ⇢ Store Cursor Position
    Stop macro and notify on failure.
  • [image]Execute Shell Script
    /bin/date | sed ‘s/:/-/g’ | sed ‘s/ /-/g’
    Save trimmed results without errors to variable “DateVar”.
    Stop macro and notify on failure.
  • [image]Set Named Clipboard “WindowName” to Text
    Labels_%WindowName%1%_%Variable%DateVar%
  • [image]Select Menu Item in the Front Application
    Select: Select ⇢ Tracks ⇢ In All Tracks
    Stop macro and notify on failure.
  • [image]Select Menu Item in Audacity
    Select: File ⇢ Export Other ⇢ Export Labels…
    Stop macro and notify on failure.
  • [image]Pause for 1 Second
  • [image]Paste from Named Clipboard “WindowName”

=-=-=-=-=-=-=-=-=-

Here is the second one, to be used while the Labels file is open in TextEdit:

Select the chosen Audacity label

Triggered by any of the following:

  • [image]The Hot Key ⌃⌥⌘S is pressed

Will execute the following actions:

  • [image]Comment “INSTRUCTIONS”
    In TextEdit or other editor, in the exported Labels file,
    position cursor anywhere on the line desired.
    The line will go into the Temporary paste buffer.
    (So if you’ve done Cmd-c copy of some audio in Audacity,
    it will still be in the paste buffer.)
    The 2 shell scripts will extract start and end time from Temporary.
    A Nyquist script is assembled inserting these times.
    In Audacity we insert the Nyquist script,
    using “Insert by typing”, again to preserve what’s already in the PB.
    This may create a new empty track. Just delete it.

  • [image]Activate TextEdit
    Bring all windows to the front.
    Notify on failure.

Etcetera… formatting the rest of it is too boring.
If anybody is interested, I’ll link to the kmmacro files. They are XML.