ImportLabels does not accept file name

OK, I think I understand.
Yes you’re correct, the “ImportLabels:” command does not take any arguments (no parameters). As it says in the manual, ImportLabels: “Launches a file selection window where you can choose to import a single text file into the project containing point or region labels.

What you want is a new command “ImportLabels2:” that works in the same way as “Import2:”
Is that right?

There are currently two simple options available (and some more complex options):

Option 1, using scripting commands only:
Read the label times with your “driving application” and add the labels (one at a time) with “AddLabel:”
Add all of the (empty) labels first.
Then read the label text with your “driving application” and set the name of each label (one at a time) with “SetLabel:”

Option 2, using a Nyquist plug-in
There’s a plug-in here that can import a label text file: https://forum.audacityteam.org/t/macros-and-scripting/57320/3
Install and enable the plug-in, then send a command from your “driving application” to run the effect, with something like:

do_command('ImportLabels:fname="c:/bin/test.txt"')

Instructions for installing Nyquist plug-ins: https://manual.audacityteam.org/man/installing_effect_generator_and_analyzer_plug_ins_on_windows.html#nyquist_install