Is there a simple list of options one can use with "do_command"?

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Emerogork
Posts: 314
Joined: Wed May 18, 2011 11:56 pm
Operating System: Windows 10

Re: Is there a simple list of options one can use with "do_command"?

Post by Emerogork » Mon Sep 07, 2020 8:43 pm

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?

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Is there a simple list of options one can use with "do_command"?

Post by steve » 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).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Emerogork
Posts: 314
Joined: Wed May 18, 2011 11:56 pm
Operating System: Windows 10

Re: Is there a simple list of options one can use with "do_command"?

Post by Emerogork » Tue Sep 08, 2020 1:02 am

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.

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Is there a simple list of options one can use with "do_command"?

Post by steve » Tue Sep 08, 2020 1:14 am

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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Emerogork
Posts: 314
Joined: Wed May 18, 2011 11:56 pm
Operating System: Windows 10

Re: Is there a simple list of options one can use with "do_command"?

Post by Emerogork » Tue Sep 08, 2020 1:24 am

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.

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Is there a simple list of options one can use with "do_command"?

Post by steve » Tue Sep 08, 2020 11:35 am

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/
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Emerogork
Posts: 314
Joined: Wed May 18, 2011 11:56 pm
Operating System: Windows 10

Re: Is there a simple list of options one can use with "do_command"?

Post by Emerogork » Tue Sep 08, 2020 6:01 pm

Sorry, I did not realize that do_command was python code.

Post Reply