I am using Emacs (25.2.1) on macOS High Sierra 10.13.2, and when trying to open a simple .txt file using Emacs as the editor, I get the error "The application Emacs is not open anymore".
Details: This error happens when Emacs is already open, and I try to open a file with it via double-clicking in Finder. Somehow, it does not happen when Emacs is closed and I open a file with it via double-clicking in Finder. After the first file is open, double-clicking does not work anymore (I get the error mentioned above), and the only way to open a file with Emacs is via C-x C-f.
Question: How can I fix the problem so that I can double-click in finder to have a file be opened with Emacs?