Avoid opening of new session tabs

Hi, I use Logic 2 to record data from long-term tests (using Python API) . For the tests I need to reconfigure the capture settings several times. In order to change the settings, I need to start and stop the capture. Since this must be in a loop, the Software opens a new session tab and stops recording at some point because too many sessions are open (similar to this problem: Reset of Session number (automation script)?).

Closing the session and restarting it for every new setting is not an option because setup time takes too long. Also python does not accept the syntax when using with automation.Manager.launch() as manager: because it requires line indent which collides with the if/else indent. A solution would be disable new session tabs or close them or use another way to launch the software which does not require line indent. Is there any way to solve this issue? Any help is appreciated!

Hi @alina.zohner,

The don’t have any immediate updates on the session number issue, but I can respond to the syntax issue.

We should make this clear in the documentation, but the with automation.Manager.launch() as manager: syntax is optional. When using the with ...: syntax, the manager will be automatically cleaned up (by calling manager.close()) on scope exit. Alternatively, you can clean it up manually.

Instead of:

with automation.Manager.launch() as manager:
    # ...

You can do:

manager = automation.Manager.launch()

# ...

manager.close()

I hope that helps. Please let me know if you have any other questions.

Ryan

Hey Ryan,

Thanks for your support and the clarification.
As a workaround, we exit the application after a certain number of session tabs and restart it.