Closed NitroCao closed 3 years ago
Hi!
It looks like the application name is actually "Microsoft Teams", so try updating the line to be:
local teams = Application:new('Microsoft Teams')
Let me know if that works!
Hi!
It looks like the application name is actually "Microsoft Teams", so try updating the line to be:
local teams = Application:new('Microsoft Teams')
Let me know if that works!
Thanks for your reply. It works!
BTW, would you please tell me what is the best way to find out the exact name of an app? This thing indicates that searching from ps
command is not good.
Great!
The name is used to retrieve the application instance using hs.application.get
that expects the localized name of the application. The best way to find the exact name would be to search on Spotlight and use the name that gets returned.
You can also list all application names and metadata using the system profiler command:
system_profiler SPApplicationsDataType
Thanks for reporting! I'm actually working on a v2
release for Ki in the develop branch. I'll consider using hs.application.find
instead to loosen the exactness of the name, so I'll keep this issue open until that release.
For example, if you change this line to use .find()
instead, you would be able to use Application:new('Teams')
.
Great!
The name is used to retrieve the application instance using
hs.application.get
that expects the localized name of the application. The best way to find the exact name would be to search on Spotlight and use the name that gets returned.You can also list all application names and metadata using the system profiler command:
system_profiler SPApplicationsDataType
Thanks for reporting! I'm actually working on a
v2
release for Ki in the develop branch. I'll consider usinghs.application.find
instead to loosen the exactness of the name, so I'll keep this issue open until that release.For example, if you change this line to use
.find()
instead, you would be able to useApplication:new('Teams')
.
Thanks for your reply, and thanks for your excellent work 👍
~/.hammerspoon/init.lua
:local Application = spoon.Ki.Application local iterm2 = Application:new('iTerm2') local pycharm = Application:new('pycharm') local music = Application:new('Music') local datagrip = Application:new('datagrip') local teams = Application:new('Teams') local outlook = Application:new('Microsoft Outlook')
local entityEvents = { { nil, "i", iterm2, { 'Entities', 'iTerm2' } }, { nil, "t", teams, { 'Entities', 'Teams' } }, { { 'shift' }, "p", pycharm, { 'Entities', 'pycharm' } }, { { 'shift' }, "m", music, { 'Entities', 'Music' } }, { { 'shift' }, "d", datagrip, { 'Entities', 'datagrip' } }, { { 'shift' }, "o", outlook, { 'Entities', 'Microsoft Outlook' } }, }
spoon.Ki.workflowEvents = { entity = entityEvents, } spoon.Ki:start()