I've been poking around to try to figure this out for you for the past couple hours. Came up with a full-on custompanel if you want to try it out. It's somewhat complicated, but from what I gathered in your post, I set it up as follows:
1. Receives number of clips in the back-to-back sequence by a few toggle buttons with additional tasks attached to each for aesthetics.
2. Updates the "ClipCount" parameter that's used later on.
3. Receives the take ID(s) and clip duration(s) for each clip in text fields below the fire button. You could probably set this up to automatically receive clip durations from XPression using DataLinq, but I don't currently have a dongle and am at home so I can't test that.
4. Waits for you to press the fire button. Fire button is described below.
a. API calls to Carbonite over IP (set in the setup tab) to perform a keyer auto-trans on.
b. Fires the first take-item using a Cue Take command over API to XPression via the IP address set in the setup tab. Then it sends a debug message with just the take ID so that you can see what's happening if something goes wrong. Lastly, it "swaps" the cued item to air over API.
c. Pauses for the first clip's duration (set in step 3).
d. Checks the ClipCount to see if it has permission to run the next tasks. If the number of clips is 2 or more, it fires the second take ID and does the same debug message and swap as in 4b.
e. Checks the ClipCount to see if it needs to pause here for the second clip. If so, it pauses for the second clip duration; if not, it pauses for 0 milliseconds and continues.
f. Checks ClipCount to see if it has permission to fire the last TakeItem. If number of clips is 3 or more, it fires the third take ID and does the debug message and swap.
g. Checks ClipCount to see if it needs to pause here for the third clip. If yes, it pauses for the third clip duration. If not, it pauses for 0 milliseconds and continues.
h. Performs a Carbonite keyer auto-trans off using the setup settings over IP/API call.
Notes: I could've had it set the pauses to 0 when there was only 1 clip selected, but that would be a pain to have to re-add the clip pauses whenever you need more than 1 at a time. Also, pauses are required to be in milliseconds.
Lastly, I really wasn't sure how exactly you're operating this based on your post, so if this is all irrelevant to what you're trying to do, let us know and I may still be able to help. Either way, you should be able to see how I built it out to check certain parameters before firing and to try to have all the buttons & parameters talk to each other as much as possible.
Here's the custompanel on my Google Drive: https://drive.google.com/file/d/1MpePn9m7Rhf5oSJZTX_pxjHZrd_WQzUx/view?usp=sharing
Hope this helps!
#DashBoard