I want to find out what project is open in the last active Atom window from an external script so I can use the project configuration in Alfred workflows (things like "open the docs for this package for the version the current project is using, etc.).
Is there an existing way to interact with Atom from external processes?
If not, I can think of two approaches off the top of my head:
Write a package that boots up a simple HTTP or socket server in Atom and interact through that. To start it could basically just
evalstrings and return the
JSONof the results or something.
Write a package that finds a way to hook into window focus and write the path to some known location.
Not sure of the feasibility of either, comments and suggestions welcome.