I'm working on an application where I can add attachments and open them etc.
I'm using the following code to open pdf files:
func open_attachment(filename):
var path = OS.get_executable_path().get_base_dir()+"/"+filename
OS.shell_open(path)
It works just fine on Windows export, but on Mac export it gives me an error: "Unable to open Application. -50"
note: the filename
is of the sort: "name.pdf"
Would you please help by providing insight as to why this is happening? And maybe a solution?
Thank you very much in advance :)
Edit:
I looked further into it and I'm not sure why the OS.get_executable_path().get_base_dir()
function returns the path to the file within the package i.e. "/Contents/MacOS".