Page 3 of 3
Re: Is there a simple list of options one can use with "do_command"?
Posted: Mon Sep 07, 2020 8:43 pm
by Emerogork
steve wrote: ↑Mon Sep 07, 2020 11:11 am
Perhaps worth trying the commands using pipeclient's command line interface - by default, it prints Audacity's response to each command, so you can see immediately if a command fails.
This is what I get:
pipeclient.png
Did you enter in each command on the interface or can they be placed in the code?
How would I bypass the "Enter command or 'Q' to quit:" option?
Batch file?
Re: Is there a simple list of options one can use with "do_command"?
Posted: Mon Sep 07, 2020 9:49 pm
by steve
Emerogork wrote: ↑Mon Sep 07, 2020 8:43 pm
Did you enter in each command on the interface
Yes, and there should be reply from Audacity to each command, as shown in that screenshot.
Emerogork wrote: ↑Mon Sep 07, 2020 8:43 pm
How would I bypass the "Enter command or 'Q' to quit:" option?
You would import pipeclient into your Python 3 program, create a client instance, and write your commands to the client instance (as described in the
docstrings).
Re: Is there a simple list of options one can use with "do_command"?
Posted: Tue Sep 08, 2020 1:02 am
by Emerogork
steve wrote: ↑Mon Sep 07, 2020 9:49 pm
Emerogork wrote: ↑Mon Sep 07, 2020 8:43 pm
Did you enter in each command on the interface
Yes, and there should be reply from Audacity to each command, as shown in that screenshot.
Emerogork wrote: ↑Mon Sep 07, 2020 8:43 pm
How would I bypass the "Enter command or 'Q' to quit:" option?
You would import pipeclient into your Python 3 program, create a client instance, and write your commands to the client instance (as described in the
docstrings).
This makes absolutely no intelligible sense to me and the link is worse. If it was not for the fact that documents like this are found all over the internet, I would find this laughable and deliberate.
I modified my python program with pipe_test.py code as a function and was able to implement a sequence of do_command statements. This is because I found an example of the do-command, modified it and have 6 lines of code in a loop to create, time, and close tracks with labels. The only problem that prevents it from being a complete solution is that I cannot name the labels.
If I use the pipeclient program, I have to enter the commands manually and this totally defeats the whole concept of automating in programming. It creates and names the labels.
If it can be done, without having to enter the statement manually:
What is the specific line of code to have pipeclient create and name a label in an instance of Audacity? If I use: SetLabel:Label="0" Text="Hello", as code within the pipeclient.py program, I get syntax errors and questions about missing indents even within statements commented out.
Re: Is there a simple list of options one can use with "do_command"?
Posted: Tue Sep 08, 2020 1:14 am
by steve
Emerogork wrote: ↑Tue Sep 08, 2020 1:02 am
This makes absolutely no intelligible sense to me and the link is worse. If it was not for the fact that documents like this are found all over the internet, I would find this laughable and deliberate.
You obviously know a lot more about how to do this than I do.
Re: Is there a simple list of options one can use with "do_command"?
Posted: Tue Sep 08, 2020 1:24 am
by Emerogork
Probably the opposite, the documentation is deliberately written without example, just theory. It stated such in the second paragraph of the doc. It is as if to say "If you are not expert enough to understand this already, then you do not belong here."
My students get big laughs out of these when they are trying to understand a new topic and get treated that way.
Re: Is there a simple list of options one can use with "do_command"?
Posted: Tue Sep 08, 2020 11:35 am
by steve
Docstrings are intended to document the code. They are not intended to provide an educational course in Python programming. Learning how to program in Python is beyond the scope of the Audacity documentation.
There are lots of Python tutorials on the Internet (Google search: "Python tutorials"). Lots of links here:
https://wiki.python.org/moin/BeginnersG ... rogrammers
This set of tutorials is pretty good:
https://python3.guide/
Re: Is there a simple list of options one can use with "do_command"?
Posted: Tue Sep 08, 2020 6:01 pm
by Emerogork
Sorry, I did not realize that do_command was python code.