I have read over here how to move an application to a specific screen. In my case I have a variation of this. In this case I want to open for example Todoist on a specific screen. This code below opens Todoist but on my wrong screen.
How can I solve this?
local screens = hs.screen.allScreens()
hs.application.open("Todoist")
local win = hs.application:findWindow("Todoist")
win.moveToScreen(screens[1])
findWindow()is an instance method, so it cannot be called directly ashs.application:findWindow(). To properly call this method, you must create an instance of thehs.applicationclass and then callfindWindow()on that instance.The following snippet should work, although you may need to adjust the wait time (and the
screensindex). It is generally recommended to use hs.application.watcher to watch for when an app has been launched, rather than using a timer.