# Getting a capture instance

**URL:** <https://discuss.saleae.com/t/getting-a-capture-instance/2862>\
**Category:** Uncategorized\
**Created:** [May 5, 2024, 10:57am UTC](https://discuss.saleae.com/t/getting-a-capture-instance/2862 "2024-05-05T10:57:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![haia.amsha98](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@haia.amsha98](https://discuss.saleae.com/u/haia.amsha98)\
**Post date:** [May 5, 2024, 10:57am UTC](https://discuss.saleae.com/t/getting-a-capture-instance/2862/1 "2024-05-05T10:57:51Z")

</div>

Hi  
Is there a way to get a “capture” instance of the running session using the API?  
I mean , I want to open Logic using python script , check if there’s a session running , if yes , return the “capture” of it?

---

<div class="post-metadata">

**Author:** ![BitBob](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/bitbob/32/2292_2.png) [@BitBob](https://discuss.saleae.com/u/BitBob)\
**Post date:** [May 6, 2024, 12:32pm UTC](https://discuss.saleae.com/t/getting-a-capture-instance/2862/2 "2024-05-06T12:32:40Z")

</div>

As far as I understand it, the [Automation API](https://saleae.github.io/logic2-automation/) is currently designed to only start its own new sessions and captures (automatically initiated via API) vs. work on an existing session that was initiated interactively (i.e., manually started by end user). There is an open idea to add this capability, if you’d like to vote on it:

> **[Automation API - Execute automation script on pre-existing session - Logic 2...](https://ideas.saleae.com/b/feature-requests/automation-api-start-capture-on-pre-existing-session/)**
>
> I'd like a way to trigger a 'start' command in the app through the API, without changing the session settings.
> 
> I often use the Saleae logic analyzer for interactively debugging a program. The original API was great for this because I could

… but for now, I don’t think your use case is supported in the current software. Instead, the Automation API currently will only start its own new tab from scratch vs. do anything with an existing tab that wasn’t started by the API. This allows the automation API to have a known starting point for ensuring repeatability in automation testing, but doesn’t (yet) inherit from any sessions with manual actions done first.
