I am trying to use Platypus to wrap a bash script to open a file in emacs using emacsclient.

The script that I am using looks like:

/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n -c "$@"

When I associate a file (using it to open org-mode files from DevonThink) to the new Platypus created app, emacs fires right up, but it opens the scratch buffer rather than a buffer with the file contents.

The above script does work when invoked from the command line.

Does anyone have any ideas?

  • I don't know osx dev nor Platpus. How the file can be passed as command-linne arguments to your script? GUI apps don't have the concept of command-line args, since they aren't CLI apps. If my guess are correct, $@ in your script is always empty. – xuchunyang Aug 19 '20 at 18:35
  • hi, @xuchunyang .. Platypus is a program that wraps a script as an application. Part of the functionality is consuming command line arguments. – sergio_101 Aug 20 '20 at 13:16
  • Then are you sure your script does get the filename as arguments? It seems emacsclient doesn't get the filename according to your description. You can try to debug your script by logging $@, e.g., echo "$@" > /tmp/log. – xuchunyang Aug 20 '20 at 16:02
  • yes, I monitored the output, and nothing is coming back. I think it might be a platypus issue – sergio_101 Aug 21 '20 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.