How to get which file is requested to open using a mac application?
- by ramsey
i have created an mac application which can be open my file extensions.
But when i tested it, i dont get the path of the file requested to open using the application,
instead i got the "psn_0_151589".
I checked it for itunes, textedit, xcode and other applications.
Below is my app sample main code where i process path of the opened file python code import sys import os.path print("File opened with this app :: ",sys.argv[1]) if(os.path.exists(sys.argv[1]): print("valid file :: { do something...}\n") else: print("Invalid file path received :: { do nothing }\n")
OUTPUT : File opened with this app :: psn_0_151589 Invalid file path received :: { do nothing }
Hope someone knows how to get the filepath which was opened using any application.
Any help would be greatly appreciated.
-ramsey