Background of this question:
I built an application by LabVIEW to open .tdms file, and I know it can receive arguments that pass to it because following code works just fine:
open -a /Application/My.app --args /path/to/file.tdms
Since command line works, I decided to associate .tdms to my application so that I can double click the file to open it, and I succeed by modifying
And things get interesting, when I try to open file either by double-click or choose app in "Open With..." list, a pop-up window shows
"My.app" is damaged and can’t be opened. You should move it to the Trash.
xattr -cr /Application/My.app would solve the problem, but it doesn't work for me.
That's why I want to know what does macOS actually do in the background when open file? How does the arguments pass to application?
I use "Open Application Reference" and Property Node in LabVIEW to receive arguments that pass to my application.
I added following code into
info.plistto associate filetype to my app:
<key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeExtensions</key> <array> <string>tdms</string> </array> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>CFBundleTypeName</key> <string>National Instruments TDMS File</string> <key>CFBundleTypeIconFile</key> <string>icon.icns</string> </dict> </array>