Search Unity

Open files of type *.abc with Unity App

Discussion in 'macOS' started by rfrank_unity, Jan 7, 2020.

  1. rfrank_unity

    rfrank_unity

    Joined:
    Jul 24, 2018
    Posts:
    4
    Hello,

    I am wondering if there is a way to do the following: I would like to double click a file on my desktop, which I have associated with ".abc" and have the OS open my unity app and get the location of said file.

    I currently have it working on Windows, using Open With... and navigating to the .exe. I then use
    System.Environment.GetCommandLineArgs() in Unity, which sees two arguments, my app and the path to the file. Is there any way to do this on OSX? I am able to open the app by clicking on the custom file type, but it only has one argument (the path to the Unity application). I don't NEED to use command line arguments either, if there was any other way to get the file location.

    I've seen these:
    https://apple.stackexchange.com/que...x-recognize-new-file-extensions#answer-175395
    https://answers.unity.com/questions/545983/how-can-i-open-a-file-from-the-finder-in-my-os-x-u.html
    but hoping there was an easier way.

    Cheers,
    - Rob