-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hs.application.open
always returns nil
#3206
Comments
By default See http://www.hammerspoon.org/docs/hs.application.html#open but in general if you're writing a Hammerspoon config that's going to be opening apps, it may well be worth taking the time to create an |
Thanks for the quick reply. I've tested more and I am not able to make
|
@cmsj can we reopen this? Or should I make a new issue? Or am I missing something? |
hs.application.open
returns nil
if given a path to an app bundle on diskhs.application.open
always returns nil
I believe this is failing because application.get requires that the application name used exactly matches the name of the running application. A fix would be changing the second argument of find to false, i.e.
You can try this snippet:
|
If you can use, bundleID seems to work always. You can get it from |
(Using 0.9.97.)
If I call
local app = hs.application.open('/Applications/Spotify.app')
or any other path in/Applications
, the call succeeds (the app gets opened/focused) butapp
isnil
.I'm not totally sure whether this is a problem with
hs.application.open
in general or has something specific to do with passing in an app bundle.I am invoking the command from the HS console.
Update: changed title to reflect the conversation below.
The text was updated successfully, but these errors were encountered: