Hi,
Wanted to understand the difference between the delegate methods "openFile" and "openFiles" used to open files with an application in MacOS.
I've tried the following scenarios:
-
Application Delegate with both openFile and openFiles methods present:
- Opening single file - In this case "openFiles" gets triggered with the file path in the filenames parameter array. "openFile" does not get called.
- Opening multiple files - In this case, again, "openFiles" gets triggered with the file paths of all the files in the filenames parameter array. "openFile" does not get called again.
-
Application Delegate with only "openFile" delegate method present:
- Opening single file - In this case "openFile" gets triggered with the file path in the filename parameter.
- Opening multiple files - In this case "openFile" gets triggered multiple times with the file path in the "filename" parameter. The number of times it gets triggered depends on the number of files that were opened by the application and each time its triggered, it gets the path of the subsequent file.
My observation was that, if "openFiles" was present in the delegate along with "openFile", the latter never gets called. Is this observation correct?
Also, since "openFIle" delegate can still handle multiple file opens at the same time, albeit it is triggered multiple times, is it safe to just use "openFile" in the delegate file(ie. not use openFiles delegate at all)?