useSfx fails to recognize when Import Session Data window is opened
Title
useSfx fails to recognize when Import Session Data window is opened
Content type
script
Content name
test sfx
Content package
SF Help
Version info
OS: macOS 15.5.0
SoundFlow: 6.0.1
Pro Tools: 25.10.0.144
What do you expect to happen when you run the script?
Open Session Import Data Window
Are you seeing an error?
Element was not found or removed after waiting 2000 ms (test sfx: Line 5)
What happens when you run the script?
It opens the Session Import Window just fine, but fails to recognize it has been opened.
How were you running this script?
Other
How important is this issue to you?
3
Details
{
"textExpected": "Open Session Import Data Window",
"textError": "Element was not found or removed after waiting 2000 ms (test sfx: Line 5)",
"textWhatHappens": "It opens the Session Import Window just fine, but fails to recognize it has been opened.",
"inputHowRun": "Other",
"inputImportance": 3,
"textTitle": "useSfx fails to recognize when Import Session Data window is opened"
}
Source
sf.ui.useSfx();
sf.ui.proTools.menuClick({ menuPath: ["File", "Import", "Session Data..."] });
sf.ui.proTools.windows.invalidate().whoseTitle.is("Open").first.elementWaitFor();
Links
User UID: 2FEbvmxaByaWbeBh5fRIjEwuOjA3
Feedback Key: sffeedback:2FEbvmxaByaWbeBh5fRIjEwuOjA3:-OcHHBg2eG7viK6AbSYf
Feedback ZIP: qI7OQla1fAnLeok02n5wRaR0mlbYh2FXc3CRowtheTGTsJNSfoI4bSTI9RH5t46ygEZuMYm53vK4UXbjnoFwCXka5KqPi38S+Cb/c/4TVYWx9KSLZU8zDQg+1+XsY8caBbOQhCHs2lSYZ745XgeuHggGpQjVUmzfmCjW41xRVY6O/WLBWjCUhwEqWWOoVh3ZBS6o2o/htJKNKyXlixiZzU6ojTQr3n8U+jgGxbBzCpBmrv3adkCzZw/AsHcjPJIajPXaJ4e3Uc7+kcmJMP7aJmZAGlyLFQx4Xmvbx+RBt2svB6Dg4yCFOsE2rRhv6SStRGUB1+xQMtWt7TlNyPsL+g==
Linked from:
Matt Friedman @Matt_FriedmanJust tested with Open -> Session... as well and same result. Script fails to wait for window to appear, even though it has appeared.
In reply toMatt_Friedman⬆:Kitch Membery @Kitch2025-10-24 18:24:52.287ZThanks for logging this.
This will be addressed in the information we will soon provide regarding converting/adapting existing scripts to SFX.
SFX will allow you to bypass open windows, so your code can be converted by this...
sf.ui.useSfx(); sf.ui.proTools.menuClick({ menuPath: ["File", "Import", "Session Data..."], filePaths: [`/Users/kitchmembery/Desktop/Session_Folder/Session_File.ptx`] });And a fallback solution could be implemented like this...
sf.ui.useSfx(); if (sf.ui.proTools.isSfxApplication) { // SFX code to bypass the "Open" dialog sf.ui.proTools.menuClick({ menuPath: ["File", "Import", "Session Data..."], filePaths: [`/Users/kitchmembery/Desktop/Session_Folder/Session_File.ptx`] }); } else { // Non SFX code to open a file in the Session Data's open window sf.ui.proTools.menuClick({ menuPath: ["File", "Import", "Session Data..."] }); sf.ui.proTools.windows.invalidate().whoseTitle.is("Open").first.elementWaitFor(); // Rest of the code to select a file in the "Open" dialog the old way... }No doubt you were just logging this issue because the code was not working, but I thought I'd provide a little extra information to help you get your scripts working in the meantime.
I hope that helps. :-)
Matt Friedman @Matt_FriedmanWait, what?!?!
You mean... no more
navigateToInDialog??? The bane of my existence???This changes everything!!!!! 🔥🔥🔥❤️❤️❤️👍👍👍
Kitch Membery @Kitch2025-10-24 19:11:09.029ZYes my friend!!! SFX is the future. :-)
- OOwen Granich-Young @Owen_Granich_Young
Does this apply to EXPORT too?! I can already Import via SDK...
This is amazing, can't wait for the documentation.
Kitch Membery @Kitch2025-10-24 21:22:07.665ZIt should do... Give it a try :-)
- In reply toKitch⬆:
Matt Friedman @Matt_FriedmanOf course the script I decide to test this on, it works great except that scripts failing later on due to some other issue. I posted a new topic regarding that issue since I’m too excited to wait for documentation.😂
Kitch Membery @Kitch2025-10-24 21:32:18.270ZI'll see if I have time to get around to it soon.
- In reply toKitch⬆:
Matt Friedman @Matt_FriedmanHi @Kitch I noticed something and thought I'd post it here before maybe starting a whole other topic.
When using SFX, in this scenario, after the script finishes if you happen to hit the key-command for Importing Session Data manually (opt-shift-i), instead of getting the normal finder dialog to search for a file to import, you are instead shown Pro Tools's import dialog, that is to say, it's re-loading the same file the script just loaded automatically, and you have to wait a couple seconds until the manual behavior return to normal in Pro Tools.
If that didnt make sense, lol, here's a video:
First, the normal behavior without SFX, then the unusual behavior with SFX enabled
https://www.dropbox.com/scl/fi/1fv71r9gr5kufoiuytjnc/Screen-Recording-2025-10-25-at-7.50.45-AM.mov?rlkey=qo6zedcdx2gqucy8ozu5fkshu&dl=0 - In reply toKitch⬆:
Matt Friedman @Matt_FriedmanHi @Kitch
One thing I can't figure out with the new SFX
filePathsproperty in amenuClickmethod is whether or not it's possible to deal with the situation when there's a Pro Tools dialog first...For example:
Export Selected Tracks as New Session...
Save Session as Copy In...Each of those require you to deal with a Pro Tools dialog before you get to the actual Save Dialog, so of course when I tried using
filePathswith those, it did not work and required going back to the oldNavigateToInDialogway.Is there a way of handling these with SFX?
- OOwen Granich-Young @Owen_Granich_Young
Hey Martin, I toyed around with it I just haven’t built an actual script with it. But basically as near as I can tell - think of the file path in export session date menu click as a call back. Automate the export window as you normally would with SFX UI and when you press ‘done/save/whatever the button that confirms your settings is named these days’ wit a SFX element click it will simply skip the file save window and execute.
Like I said I only roughed it in quickly, have not sat down and committed to a full build but that seems to be the way.
Happy coding!
Owen
Matt Friedman @Matt_FriedmanThat doesn't work, actually. Once you disperse with the intermediate window (either manually or via SF) you get one of these wonderful errors.

- OOwen Granich-Young @Owen_Granich_Young
Yes, so, kind of funky but in your file path on the menu click define the name of the session too, just as if you were saving the file. 😅 sorry I didn’t mention that I futzed when I did it and did get it to generate a session that way.
Matt Friedman @Matt_FriedmanStill no success. With this code, it gets through w/o errors. But nothing is actually saved to the destination.
sf.ui.useSfx(); function exportSelectedTracks(path, name) { if (!sf.ui.proTools.selectedTrackCount) { return } const savePath = `${path}/${name}`; const saveName = `${savePath}/${name}.ptx` sf.ui.proTools.menuClick({ menuPath: ['File', 'Export', 'Selected Tracks as New Session...'], filePaths: [savePath, saveName], }); const win = sf.ui.proTools.windows.whoseTitle.is("Save Copy In...").first; win.elementWaitFor(); win.checkBoxes.whoseTitle.is("Audio Files").first.elementClick(); win.buttons.whoseTitle.is("OK").first.elementClick(); win.elementWaitFor({ waitType: "Disappear" }); } exportSelectedTracks('~/Desktop', 'Test');
Matt Friedman @Matt_FriedmanI figured it out. It seems that we can't use the "Tilde" in this situation. You need to explicity define the path like
/User/matt/Desktopand not do something like~/Desktop
Kitch Membery @Kitch2025-11-03 18:34:44.582ZYes, that may be the case... Can I get you to log a Help/Issue report for this when you have a chance? :-)
Thanks in advance.
Matt Friedman @Matt_Friedman
- In reply toMatt_Friedman⬆:OOwen Granich-Young @Owen_Granich_Young
Thanks for doing the research, clipping and copying, lol. Luckily for me, most of the scripts I use this with do not involve a ~, great work on this function man!
- In reply toMatt_Friedman⬆:
Kitch Membery @Kitch2025-11-03 19:27:05.085ZOut of interest, does it by chance work without the tilda?
Matt Friedman @Matt_FriedmanIt works if you specify the explicit path, but that's not useful when you don't know the system the script will run on, hence the Tilde
To get around that I'm programmatically replacing the tilde if it exists, with
sf.appleScript.finder.home.path.toString()
Kitch Membery @Kitch2025-11-03 21:02:45.007ZThanks @Matt_Friedman.
Glad you found that workaround. :-)