Pipeclient

Using W10, python and pipeclient

With this code
#export sound labels
client.write(f’ExportLabels:filename=“C:\Scripting Audacity\SoundLabels\Sound_Labels.txt” hasname=“No” hasnumber=“No” hastext=“Yes” hastimes=“Yes” overwrite=“Yes” separator=“Tab”‘)
get_reply()
#close the file without saving
client.write(f’Close:’)
get_reply()

works well enough, until the modal dialog boxes pop up asking to confirm… Is the any configuration to suppress or a routine to ‘click’ the Okay?

Unfortunately not.

There’s a similar issue with the “Export” command (it opens the “Export” dialog. However, in this case there is also a command “Export2” which exports a file without prompting. Ideally there would be another command “ExportLabels2”, to export labels without prompting, but that command does not exist.

An alternative solution is to use the “GetInfo” command to get the label data:

GetInfo: Type=Labels

which returns something like:

[ 
  [ 1,
    [ 
      [ 0, 0, "01Labe1l" ],
      [ 10, 10, "02Label1" ],
      [ 20, 20, "03Label1" ] ] ],
  [ 2,
    [ 
      [ 0, 0, "01Label2" ],
      [ 3, 3, "02Label2" ],
      [ 6, 6, "03Label2" ],
      [ 9, 9, "04Label2" ],
      [ 12, 12, "05Label2" ],
      [ 15, 15, "06Label2" ],
      [ 18, 18, "07Label2" ],
      [ 21, 21, "08Label2" ],
      [ 24, 24, "09Label2" ],
      [ 27, 27, "10Label2" ] ] ] ]
BatchCommand finished: OK

As you can see, the main reply is the label data in JSON format. You could then reformat the data any way you like.

Thanks for the alternative approach. Much appreciated