Open files with ofApp (custom file extension)

Hello helpful people,

I’d love to use my ofApp to open files with the extension ‘’.q".
If I try to open my file in osx with I get the messge:

The message remains even after trying to set the settings you see in the image.

The only thing I got to work, is using the Application from terminal with extra arguments that specify the path to the file I want to open and then parsing these arguments myself, but that’s not very helpful.

Is there some setting I am missing?

If you don’t already have the arguments for void main(){ in main.cpp you will need those.

I see here you need to register the file in the plist of the Application:
" To declare its support for file types, your app must include the CFBundleDocumentTypes key in its Info.plist"

I don’t think you need to do the rest of the steps in the answer though.

1 Like

The Settings I sent a screenshot of resulted in this Info.plist file:

my main looks like this:

int main( int argc, char * argv[])
{...}

I parse and log the arguments but I dont’t get any extra arguments opening the .q file by double clicking (with my app as standart app). I know I can use the arguments to open it from command line, but that’s not what I want.