Proper Written Documentation of API is needed besides Updates
-
@Lindon Then
C:\Users\Tania\AppData\Roaming\PluginsName
-
@Tania-Ghosh said in Proper Written Documentation of API is needed besides Updates:
@Lindon Hmm.. But unable to figure out var callback and var startFolder
E.g
FileSystem.browseForDirectory(var startFolder, var callback)if you dont know how to use the var callback - you should go read some javascript documentation about function calls.
-
@Tania-Ghosh said in Proper Written Documentation of API is needed besides Updates:
@Lindon Then
C:\Users\Tania\AppData\Roaming\PluginsName
Write. Some. Code.
simple console print statements that show you the values for the special locations on your machine...
..and read the documentation it clearly states:
AppData The app data directory. This is the main directory for your project which will house the configuration files and user presets.
-
so this:
FileSystem.browse(FileSystem.AppData, false, "*.txt", function(result) { // the parameter is a File object, so we just show it // in the OS' file browser. result.show(); });
Which by the way is taken almost entirely from the existing documentation...
-
Content.makeFrontInterface(500, 400); const var appDataFolder = FileSystem.getFolder(FileSystem.AppData); const var presetsFolder = appDataFolder.getChildFile("User Presets"); const var Button1 = Content.getComponent("Button1"); inline function onButton1Control(component, value) { FileSystem.browse(presetsFolderUser, false, "*.preset", function(file) }; Content.getComponent("Button1").setControlCallback(onButton1Control);
What I am doing wrong here?
-
@Tania-Ghosh The last parameter needs to be a function. A function looks like this
function (parameters) {}
Remember this is a parameter inside the
.browse
function call so you also need to put a closing parenthesis like you would for anything other function call.There are plenty of example of this kind of thing on the forum. Here for example: https://forum.hise.audio/topic/2807/new-api-server-and-filesystem?_=1618742189142
-
HiseSnippet 962.3ocsV0saaaCElxwpXVctXEXO.B9JkAOC4sztALLrj3XO3skTio1hdWAsDsMQnHEDoRpQQA1i7dC1NTTxhJwsK0.yW4yu76b347QsHWDSjRQNxo2K2lQPNeoazVtZyjMXJGM+BjySbuDKUjbeipy2lgkRRBxw4neUqvoWWT4u+9WNGyv7XRiJD50BZL4OnoTUi1Em96TFaFNg7RZpk2mb57XAehfIJ.7bjaHJCGeMdM4Jr1sNtHmGMMgpD4QJrhHAeNWjrMZi3Vtw+WSkzkLhVXLJBRjQMZxFJKYQcsJQHmtKZp7iLU9W6dIMgtSeSG3qJM32DgcOvoSaH0sEjF+wfzLAKQmfOB7brfWWC7dpaTbNMS0XQisG6NmCWNqvPa2FVFeQcV2wch.7fqFkhulLKGD1EQvyBCG5eRX3w+TeOn0KU92fy8wYYWfU3RHl6+y9ynLRzVXFHczZhxnNvR4YF+amjrbhjnj6RRqjpySYQqyRvfWIAWVXBXfNM1I57BkRvGContPzAKRyDbPHXPk8p356Q4LJm3upfGqnBtufW4gN7bAKHtN1gP9YEji66899d8rJnk4hakjfVkfFiC8WgYRxP+AeyHiwAC2cPAfhBl5XCJ9fFN8z+6+.0ijZ8kHaBlwVBS7A2Ex0kVeOqp5Jgh7Bdvwdu2qm2G77uqoUq1qspTxfqv8YVuQl+oBLfWjtT2JL8tZGgwz16AO9gsGDa5NVNJ3y4T0KxHUxMaJZalpt1ZHZWwZqpoFs0VVZ6wsFU2eQDUc6oWIqbGbUUtP9jpERycEhBXrma0EGpr6XyMhd0b87echfbBmSFIWQ0cKmKH2.DklM8dtWPjWqDYk9VMx.beOfi8cMG4uc51cB+07Sukln1fbbcdCHugPWuQokddIg78Ha.JOQRACqZyCpI7qL.CEsHbzjJbIUs0tn+LHGC2K4338cm7.g6ScWPUwa1Od6rG7B2M+ei2pmZ56Nc0JRrpArccm8lC8ckOCn7mhBEku9RrJmByJtWUjFAu1FS.jv4DlTOSzQO2ajC0x5NSDgmTJ7OvuJii0xNUFGWaDkhiyEuM1rsneL6KJ0.XhW9NdO3CJ.Y+cKIttgiBQovaruMNV2J9V.66Olu6.h46OfXN4.h4YGPLO+.h4GNfX9wOYL5Ou4rBkH0rlzv0ALn.StsfqyiZOQa+AHkm0bdB4c0CCvzatxdCaJOwlfXVAicOezJuieQWSt0Vt7LgRxV2YJXndYghXSHNmeCvwZVoPWtXZIGriyTNFVdLZ+WDiBDfK
Not working
-
@Tania-Ghosh That's the same code in your last post. You haven't written the callback function properly and you haven't put the closing parenthesis on the
.browse
function call. Take a look at the examples in the link I posted. -
@d-healey Sorry but didn't understand...
-
Found from this post
var folder = FileSystem.getFolder(FileSystem.Expansions).getChildFile("UserPresets"); FileSystem.browse(folder, false, "", function() {});
-
@d-healey Ok Done... Prob Solved.
Thank you :)
-
@Lindon . Thank you man for nice Explanation. (y)
-
@Tania-Ghosh any time.