Problems with opening a file path during create session. SFX update.
So I have a script that creates a session at a given location based on what I select in finder. On updating to try to use SFX it's causing me some issues.
Here's the problematic snippet. Its being fed a path from another part of the script which is working correctly
The script has the use SFX line at the top.
sf.ui.proTools.menuClick({ menuPath: ["File", "New..."] })
sf.wait({ intervalMs: 100 })
sf.ui.proTools.sfx.dashboardWindow.elementWaitFor();
sf.ui.proTools.sfx.dashboardWindow.groups.whoseTitle.is("Dashboard Navigation Bar").first.buttons.whoseTitle.is("New Tab Button").first.elementClick();
sf.ui.proTools.sfx.dashboardWindow.groups.whoseTitle.is("New Tab Content").first.groups.whoseTitle.is("New Session Tab Content").first.textFields.whoseTitle.is("Session Name").first.elementSetTextFieldWithAreaValue({ value: sessionName });
sf.ui.proTools.sfx.dashboardWindow.groups.whoseTitle.is("New Tab Content").first.groups.whoseTitle.is("New Session Tab Content").first.popupButtons.whoseTitle.is("I/O Settings").first.popupMenuSelect({ menuPath: ["Nimrod Dub Session Default"] });
sf.ui.proTools.sfx.dashboardWindow.groups.whoseTitle.is("New Tab Content").first.groups.whoseTitle.is("New Session Tab Content").first.popupButtons.whoseTitle.is("Save To Location").first.popupMenuSelect({ menuPath: ["Prompt for location"] });
sf.ui.proTools.sfx.dashboardWindow.groups.whoseTitle.is("New Tab Content").first.groups.whoseTitle.is("New Session Tab Content").first.checkBoxes.whoseTitle.is("Use Template").first.checkboxSet({ targetValue: "Disable" });
sf.ui.proTools.sfx.dashboardWindow.groups.whoseTitle.is("New Tab Content").first.groups.whoseTitle.is("New Session Tab Content").first.buttons.whoseTitle.is("Create").first.elementClick();
//Set session path
sf.wait({ intervalMs: 100 })
sf.ui.proTools.windows.whoseTitle.is("Save").first.buttons.whoseTitle.is("Save").first.elementWaitFor();
sf.keyboard.type({ text: '/' });
sf.ui.proTools.windows.whoseTitle.is("Save").first.sheets.first.textFields.whoseValue.is("/").first.elementWaitFor();
sf.wait({
intervalMs: 200,
});
sf.keyboard.press({ keys: 'backspace' });
sf.keyboard.type({
text: folderPath
});
sf.wait({
intervalMs: 200,
});
sf.keyboard.press({ keys: 'enter', });
sf.wait({
intervalMs: 500,
});
sf.ui.proTools.windows.whoseTitle.is("Save").first.buttons.whoseTitle.is("Save").first.elementClick();
So it's not finding the save window when I waiting for the element.
I tried to remove that line which led to soundflow going too fast and typing the file path into the wrong box.
I hoping there is a better way todo this as this is janky at best given all the waiting using Ms rather than elements etc but it's just how I got it working a year or so ago.
Thanks in advance !!
Christian Scheuer @chrscheuer2026-01-28 16:59:40.916ZI don't have much time to write, but just wanted to give some quick pointers:
OS-style dialogs such as Save dialogs are not supported via SFX, since SFX only communicates between Pro Tools and SoundFlow. For this part of the script you could either use the built-in SFX hooks to bypass opening the Save dialogs in the first place, or you could make sure that section of the script uses Accessibility to still communicate with the OS dialogs.
If you're trying to create a new session from a template, there's also a PT SDK action that may be able to get what you want with no UI automation (SFX or AX).
Jack Green @Jack_GreenThanks for taking the time to reply.
For now I've used the create session SDK command from below as thats really nice and clean.
I do still need the file path stuff for other scripts that use session data import? However I did just find the SDK command for importing session data so going to look into that...
Christian Scheuer @chrscheuer2026-01-29 17:50:12.761ZYou can read more about open/save dialogs in SFX here:
https://soundflow.org/docs/scripting/adapting-scripts-for-sfx#open-and-save-dialogs
- BIn reply toJack_Green⬆:Brandon Jiaconia @Brandon_Jiaconia
Here's an example of the PT SDK action that you might have better luck with
sf.app.proTools.createSession({ fileType: "WAV", sampleRate: "SR48000", bitDepth: "Bit24", inputOutputSettings: "IOLast", isCloudProject: false, isInterleaved: true, sessionName: sessionName, parentDirectory: folderPath })and a good thread on this