Closing the project from macro

Questions, discussion and recipes for scripting and batch processing in Audacity.
See also the "Scripting" section of the Audacity manual.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Msv264
Posts: 13
Joined: Mon Apr 05, 2021 8:08 pm
Operating System: Windows 8 or 8.1

Re: Closing the project from macro

Post by Msv264 » Wed Apr 07, 2021 4:18 am

Ok, thank you for an explanation.
I will try Python scripting.
But I think it would be helpful if somebody add to manual some words about Close command not suitable for macros.

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

Re: Closing the project from macro

Post by steve » Wed Apr 07, 2021 8:47 am

Msv264 wrote:
Wed Apr 07, 2021 4:18 am
I think it would be helpful if somebody add to manual some words about Close command not suitable for macros.
Most people would probably not use the "Close" command because it isn't in the Macro Editor. If I recall correctly there's a few other commands that are excluded from the Macro Editor (because they are unsuitable for macros).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

waxcylinder
Forum Staff
Posts: 14586
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Closing the project from macro

Post by waxcylinder » Wed Apr 07, 2021 3:28 pm

steve wrote:
Wed Apr 07, 2021 8:47 am
Most people would probably not use the "Close" command because it isn't in the Macro Editor.
Which begs the question then: just how does one get a "Close" command in a Macro ? :?

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

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

Re: Closing the project from macro

Post by steve » Wed Apr 07, 2021 4:54 pm

waxcylinder wrote:
Wed Apr 07, 2021 3:28 pm
steve wrote:
Wed Apr 07, 2021 8:47 am
Most people would probably not use the "Close" command because it isn't in the Macro Editor.
Which begs the question then: just how does one get a "Close" command in a Macro ? :?
You would need to manually edit the macro's .txt file.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Msv264
Posts: 13
Joined: Mon Apr 05, 2021 8:08 pm
Operating System: Windows 8 or 8.1

Re: Closing the project from macro

Post by Msv264 » Wed Apr 07, 2021 7:28 pm

I think the explanation Steve presented in this discussion is very useful for understanding how macros really work.
It will really help people if it would be added to manual.

waxcylinder
Forum Staff
Posts: 14586
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Closing the project from macro

Post by waxcylinder » Thu Apr 08, 2021 11:49 am

Msv264 wrote:
Wed Apr 07, 2021 7:28 pm
I think the explanation Steve presented in this discussion is very useful for understanding how macros really work.
It will really help people if it would be added to manual.
So, which particular bit (or bits) that Steve wrote do you think would be useful in the Manual ?

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

Msv264
Posts: 13
Joined: Mon Apr 05, 2021 8:08 pm
Operating System: Windows 8 or 8.1

Re: Closing the project from macro

Post by Msv264 » Fri Apr 09, 2021 9:39 pm

1. I would suggest adding following text in general article about macros:
The macro is running as the current project and cannot complete if the project is closed. So the "Close" command can't be used in the macro.
You can create a new project with a macro, but that macro can't do anything in the new project because it's a different project. When a macro runs, it is acting on the project in which it was opened.

2. Also it would help if some text will be added to the description of the interface of the Macro Editor, where batch file processing is explained:
Audacity allows to apply a macro to multiple audio files. Applying a macro to multiple Audacity projects can't be done with a macro, if you wish to do it, you need to use Python scripting.

3. It also won't hurt to add some direct explanation to the description of "Close" command:
"Close" command is excluded from the Macro Editor because it can't be used in the macro.

waxcylinder
Forum Staff
Posts: 14586
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Closing the project from macro

Post by waxcylinder » Sat Apr 10, 2021 11:12 am

Msv264 wrote:
Fri Apr 09, 2021 9:39 pm
1. I would suggest adding following text in general article about macros:
The macro is running as the current project and cannot complete if the project is closed. So the "Close" command can't be used in the macro.
You can create a new project with a macro, but that macro can't do anything in the new project because it's a different project. When a macro runs, it is acting on the project in which it was opened.
Yes, but there is no "Close" command available in Macros - it's only the clever uber-geek folk that play around with editing their Macros with a text editor and add in non-standard Macro commands. The Close was left out of the menu of commands available to Macro Manager on purpose.

You might argue that the macro Manager or the Macro Palette should reject any Macro that has an "illegal" command like "Close" in it. But that would be an enhancement request.

The Manual is written on the basis the we expect folk to use the Macro Manager as their way of building Macros.

Msv264 wrote:
Fri Apr 09, 2021 9:39 pm
2. Also it would help if some text will be added to the description of the interface of the Macro Editor, where batch file processing is explained:
Audacity allows to apply a macro to multiple audio files. Applying a macro to multiple Audacity projects can't be done with a macro, if you wish to do it, you need to use Python scripting.
I can think about adding something along these lines - I have to make some changes anyway to the Macros pages as a result of fixing a recent bug.

Msv264 wrote:
Fri Apr 09, 2021 9:39 pm
3. It also won't hurt to add some direct explanation to the description of "Close" command:
"Close" command is excluded from the Macro Editor because it can't be used in the macro.
I'm not convinced that this is necessary - but I will give it some thought.

@Steve: are there any other commands that are deliberately excluded for Macros Manager ?

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

waxcylinder
Forum Staff
Posts: 14586
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Closing the project from macro

Post by waxcylinder » Sat Apr 10, 2021 11:26 am

waxcylinder wrote:
Sat Apr 10, 2021 11:12 am
Msv264 wrote:
Fri Apr 09, 2021 9:39 pm
2. Also it would help if some text will be added to the description of the interface of the Macro Editor, where batch file processing is explained:
Audacity allows to apply a macro to multiple audio files. Applying a macro to multiple Audacity projects can't be done with a macro, if you wish to do it, you need to use Python scripting.
I can think about adding something along these lines - I have to make some changes anyway to the Macros pages as a result of fixing a recent bug.
Curiously I've just discovered that you can actually in 3.0.0 run Macros on 2.4.2 and earlier created older AUP files.

This is because in 3.3.0 only File>Open can be used to open the new AUP3 projects.

BUT with the old AUP project files from 2.4.2 and earlier for some strange reason (I've forgotten why) the developer who worked on Unitary Project enabled File>Import as well as File>Open to operate on AUP files - and thus Macros can work on AUP project files because they can Import them.

I can see that it might be useful for Macros to work on AUP3 projects as well as older AUP ones - so I'll consider adding an ENH enhancement request for this.

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

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

Re: Closing the project from macro

Post by steve » Sat Apr 10, 2021 11:28 am

waxcylinder wrote:
Sat Apr 10, 2021 11:12 am
Yes, but there is no "Close" command available in Macros - it's only the clever uber-geek folk that play around with editing their Macros with a text editor and add in non-standard Macro commands. The Close was left out of the menu of commands available to Macro Manager on purpose.
It may be worth noting on this page: https://alphamanual.audacityteam.org/ma ... _Reference
in the Intro section, that a few commands are intentionally omitted from the Macro manager (such as "Close:") because they are unsuitable for use in macros.

(I'm not sure if we can update the manual at the moment or if we need to wait for Audacity 3.0.1 to be released).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply