As title.
What do you mean by "directly" - without prompting the user? You can only do this in NWJS export. Use NWJS action Write Binary File. I guess you'll have to load CanvasSnapshot into the BinaryData object first.
Is there an example for how to do it?
I think it should be something like this. But it won't work in preview, you'll have to export it to NWJS to test.
Develop games in your browser. Powerful, performant & highly capable.
It worked, thank you!
Is there a similiar way to open a folder in my PC from the game?
What do you mean? You can show "Select folder" or "Select file" dialogue using NWJS actions, check out the documentation:
construct.net/en/make-games/manuals/construct-3/plugin-reference/nw-js
Show folder dialog opens a dialog from which you choose a folder, i meant a way to directly open a given folder from ingame, like <NWjs.UserFolder & "\Documents\DinoSystem\">
What do you mean by "open a folder"? Show "Open file" dialogue? Or launch Windows Explorer? Or display the list of files from this folder inside your Construct app?
Launch windows explorer
You can try NWJS Run File action with this path:
"explorer.exe " & NWjs.UserFolder & "\Documents\DinoSystem\"
It strangely opens only the documents folder, although the DinoSystem folder is already present
You might need to experiment, perhaps it requires double quotes:
"explorer.exe """ & NWjs.UserFolder & "\Documents\DinoSystem\"""
Tried the double quotes, still nothing, it opens the Documents folder, but any folder inside it is not opened, even "My Games" or any other.
Add a temporary Text object to the layout, print NWjs.UserFolder to it. See what path it returns. Maybe you don't need to append "\Documents\DinoSystem" to it.
Then try executing explorer.exe from CMD with that path.
Spotted the issue!
It returns the correct path, BUT adds \\ after the user folder -> C:\Users\Daniel\\Documents\DinoSystem
It works now after addressing removing it.
Thank you!