# In an add-on, receive the path to the file Blender was opened with or its launch arguments?

I want to write an add-on that can open a file opened with Blender (i.e. double clicked while Blender is the default program associated with the file format). That means Blender is opened with launch arguments holding the path to the opened file. This must work for file formats other than .blend, such as .fbx. In the Python code for an add-on, how can I access the path of the file opened with Blender. Or the arguments Blender launched with?

bpy.context.blend_data.filepath - full path and name of opened .blend file. I doubt there is something for imported files, because they are "adding" to scene, not "opening"
import sys

• Alternatively, for getting the path of the opened .blend file you can use bpy.data.filepath which gets you the exact same file path as the above method. – scribblemaniac Jan 1 '16 at 1:33