Choose files
Last updated
Was this helpful?
Last updated
Was this helpful?
This page is all about letting a user choose a file from their file system. NovaOS lets users select files from the registered app which has its capabilities including 'file'.
To allow for customizability, NovaOS lets users use a files app of their choice. But which files app do we open to choose a file?
fileTypeAssociations
is a system that lets apps register their supporting file types - file types they can handle.
Now, as we got appIdToOpen, which is the files app we can request to let the user choose a file, lets ask it.
Here is the method to summon a choose file window with the default files app in NovaOS.
Here, we use the to launch the application with the data, which has some params.
Apps can access this feature through the myWindow
method. To use the myWindow method, you have to use the greenflag()
function. Otherwise, it will return undefined. This is due to the fact that the myWindow
object is only defined after the app document is loaded.
More: , .
opener
A file type to filter with.
"opener":"json" "opener":"app"
dir
A directory to initialize the choose file window with.
"dir":"Downloads/" "dir":"Apps/"
Here is a snippet that recives a file from a choose file window.