If you put that code inside an event, a method etc.. yes it should work.
But when you put it in the global scope, you should pay attention that the studio will evaluate your script to check if you have defined any methods, events etc.. and the methods getFolder
and ds.getModelFolder
are not always available on the global scope.
This also means that requiring modules located in the project's modules folder from the global scope will cause an error as well (but requiring a module using relative path should work)
Work is being done to make using filesystems inside the model.js file possible (/PROJECT/..
)