Just wanted to give some feedback on this.Your suggestions worked out fine, I could implement what I had planned. Thanks!
However, one thing bugs me a bit.I need to create the new file in a place within the current project folder. In another part, I need to replace the current project folder in a path with something else. Obviously, for all of that I need the current project folder.
They way I am getting this folder at the moment is iterating over file tree parents until I find the upmost and use its text as the path. That works, but seems REAAAAALLLY hacky. Is there a less hacky way to receive the current project path?