Preset problem
-
..hmm whats wrong with this piece of code?
local plist = Engine.getUserPresetList(); for (i = 0;i<plist.length;i++) { if(plist[i].contains(myPresetName.get("text"))) { Console.print(plist[i]); Console.print(plist[i+1]); Engine.loadUserPreset(plist[i+1]); } }
when it runs it prints the required preset name, and then tells me it doesnt exist:
Interface: ALL/00 - Solo Instruments/00 - Brass Stacks Interface: ALL/00 - Solo Instruments/01 - Trumpet Interface:! NF_Presets.js (115): User preset F:\Audio\Channel Robot\Hise_Work\Nightfox\BrassStacks\UserPresets\ALL\00 - Solo Instruments\01 - Trumpet doesn't exist
-
@Lindon
loadUserPreset
takes a relative path or a file object.Looks like you're passing an absolute path.My mistake. I think you just need to add the file extension.preset
-
@d-healey - thanks yep - works like a dream....
-
Should I remove the ability of passing in anything else than a file object? This will prevent those kind of problems in the future...
-
@Christoph-Hart I think it can be useful to pass in a string the way Lindon is, it skips out the step of having to get the file from the path (which would still require him to add the file extension).
-
@d-healey said in Preset problem:
@Christoph-Hart I think it can be useful to pass in a string the way Lindon is, it skips out the step of having to get the file from the path (which would still require him to add the file extension).
agreed.
-
Alright, then we'll keep it that way. In my brain the method is broken if you don't pass in a file object so I will never use it like that, but if it works for you :)
-
@Christoph-Hart its more about being able to use it with the results of
Engine.getUserPresetList();