I had to change the way pendingOpenFiles works, because of a timing problem. When another app launches Brackets using "NSWorkspace.launchApplicationAtURL:options:configuration:error", the order in which things happened inside Brackets is (1) ClientAppDelegate.createApp is called, which copies pendingOpenFiles to gPendingFilesToOpen (2) the OpFl apple event is received (3) the JS code becomes ready to handle SendOpenFileCommand. Unfortunately, at step 2 we were trying to call SendOpenFileCommand, because it was too late to use pendingOpenFiles. So, I changed the code so that pendingOpenFiles is still available at step 2, and only gets flushed when the app is really ready, which is when GetPendingFilesToOpen gets called.