Save Filepaths remain persistent - is this a bug? If not how to pass filePaths to DAW save commands
In the following script I use the "Save Session Copy In…" DAW command to save selected tracks in an open session as a new session via the "Selected Tracks Only" check box.
When clicking the OK button, I pass the file path for the new session as described in the SFX documentation on the SF website.
Immediately following the save I call the Import Session Data command via SFX.
Here's the anomaly: I'd expect an open file dialog to appear to select the session to be imported but instead the Import Session data window opens immediately with the previously saved session.
So this leads me to believe that:
1)sessionFilePaths remains persistent (a bug?).
2) if not a bug, how do you pass a session path to an open dialog generated by a SFX / DAW command or change the persistent filePaths ?
Here's the code:
if (sf.ui.useSfx && !globalState.OPP_disableSfx) sf.ui.useSfx();
const runDawCommand = (commandName, props) => sf.ui.proTools.sfx.dawCommands.getByUniquePersistedName(commandName).run(props)
const SAVE_COPY_IN_PATH = '/Volumes/Work Drive/Dropbox/Boulevard/Copy of Talk Without Speaking-Ready For Mix/DNU-Tracks.ptx'
runDawCommand("SaveFrontDocumentCopy") // <<--- save copy in command
const saveCopyInWindow = sf.ui.proTools.windows.whoseTitle.is("Save Copy In...").first;
saveCopyInWindow.elementWaitFor()
const audioFilesCb = saveCopyInWindow.checkBoxes.whoseTitle.is("Audio Files").first;
const sellectedTrackOnlyCb = saveCopyInWindow.checkBoxes.whoseTitle.is("Selected Tracks Only").first;
if(audioFilesCb.isCheckBoxChecked)audioFilesCb.elementClick()
if(!sellectedTrackOnlyCb.isCheckBoxChecked)sellectedTrackOnlyCb.elementClick()
const okButton = saveCopyInWindow.buttons.whoseTitle.is("OK").first;
okButton.elementClick({
filePaths: [SAVE_COPY_IN_PATH]
});
runDawCommand("ImportTracks")
If I run other DAW commands after the save copy in command then run the Import Session Data DAW command it immediately opens to the ISD window with the saved session.
Chris Shaw @Chris_Shaw2025-11-30 23:24:02.824Z2025-11-30 23:54:04.492ZAdditionally, if I remove the Import Session Data DAW command from the script (the last line) and invoke it via shift-opt-I the iSD window appears immediately with the saved session.
If I cancel, then press shift-opt-I again, the open dialog appears as expected.
In reply toChris_Shaw⬆:Chris Shaw @Chris_Shaw2025-11-30 23:52:04.457ZRelated How to post:
How do you pass a file path and open a session with SFX or DAW commands?
In reply toChris_Shaw⬆:Kitch Membery @Kitch2025-12-02 00:22:34.344ZNote: I will take this with Chris offline, as I think I may need to add some more info about this to the SFX documentation. :-)
In reply toChris_Shaw⬆:Matt Friedman @Matt_FriedmanI noticed the same thing here, video as well!
Basically, its like the open/save dialog is bypassed for several seconds after an SFX filepaths event occurs.
In reply toChris_Shaw⬆:Kitch Membery @Kitch2025-12-03 18:23:28.014ZHi @Chris_Shaw,
There are two ways to pass a session path to the Import Session Data's open dialog with SFX.
1.Via the Menu Click method.
sf.ui.useSfx(); sf.ui.proTools.menuClick({ menuPath: ["File", "Import", "Session Data..."], filePaths: [`PATH TO SESSION`] });2.Using the
elementClickMethod associated with the "Import Tracks" DAW Command.sf.ui.useSfx(); sf.ui.proTools.sfx.dawCommands.getByUniquePersistedName("ImportTracks").menuItem.elementClick({ filePaths: ["PATH TO SESSION"], });
Kitch Membery @Kitch2025-12-03 18:33:53.648ZPlease also note that when SFX is enabled, you need to specify a path when an element or a menu item, when clicked, reveals an Open or Save dialog. And you can do this by using a similar method to what I mentioned in my previous reply.
You can also bypass SFX for this step, as shown in the adapting scripts for SFX documentation.
In reply toChris_Shaw⬆:Kitch Membery @Kitch2025-12-03 18:42:17.938ZFYI: we're tracking an issue where the Tilde ("~") paths can't be used right now for passing paths with SFX. Just in case you were not aware.