It works as it is now, here's the js:
"var fs = require('fs');fs['writeFileSync']('" &replace(NodeWebkit.UserFolder&"\Documents\"&"\DinoSystem\"&"\History\" & "DScreen" & SnapN & ".jpg","\","\\")& "','" &CanvasSnapshot& "'.split(',')[1], {'encoding': 'base64'});"
the SnapN is just a variable to number the screens
Is there any advantage in changing to the way you suggested?
PS: is there a way to tell the game to delete a folder? Looks like i can delete only a single file, but i want to delete all files in the given folder or the whole folder. Just an optional thing though.