Engine.saveUserPreset(value) in any dir?
-
Is it possible to redirect the
Engine.saveUserPreset(value);
to save in whatever folder inside "User Presets"?
-
@ulrik As far as I'm aware this only saves the currently loaded preset, it doesn't save a new preset. Or does it?
-
@d-healey I'm working with my "compare" script and
Engine.saveUserPreset(newName);
will save the loaded preset that have been modified in to a new preset with a new name, and it's working nicely, however it saves the new preset into the same category folder as the original preset.
I want the user to chose the category folder -
@ulrik Did you happen to find a solution to this? Trying to do the same thing and having no luck
-
Yes it's possible. I posted a video about it on Patreon a couple of months ago showing how to prompt the user to select a location for the preset.
Here's the code I'm using in one of my projects. I'm using expansions so you'll need to modify the first line in the function for non-expansion projects. (The version in the video is simpler).
inline function createNewPreset() { local userPresetsFolder = Expansions.getCurrentUserPresetsFolder(); if (!isDefined(userPresetsFolder)) return; FileSystem.browse(userPresetsFolder, true, "*.preset", function[userPresetsFolder](f) { var grandparent = f.getParentDirectory().getParentDirectory().getParentDirectory(); if (!userPresetsFolder.isSameFileAs(grandparent)) return Engine.showMessageBox("Invalid Location", "Presets must be saved in a bank and category folder within the instrument's user presets folder.", 0); Engine.saveUserPreset(f.toString(f.FullPath).replace(".preset")); }); }
-
@d-healey Thank you!