-
Notifications
You must be signed in to change notification settings - Fork 50
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
WinExist in another virtual desktop #68
Comments
what do you mean ? can you write pseudocode ? if (VD.WinExistInDesktopNum(winTitle,desktopNum:=2)) {
WinActivate(winTitle)
} else {
Run(command)
} 2) if (VD.WinExistInAnyDesktopNum(winTitle) {
WinActivate(winTitle)
} else {
Run(command)
} 3) if (VD.WinExistInDesktopNum(winTitle,desktopNum:=2)) {
WinActivate(winTitle)
} else {
VD.MoveWindowToCurrentDesktop(winTitle)
WinActivate(winTitle)
} |
Personally I would like
and
Unless there is is another way to know if a given window exists, and then move it to current desktop. |
@Morgenkaff DetectHiddenWindows 1
if (WinExist(winTitle)) {
VD.MoveWindowToCurrentDesktop(winTitle)
} else {
Run(command)
}
if (VD.getDesktopNumOfWindow(winTitle)!==VD.getCurrentDesktopNum()) {
VD.MoveWindowToCurrentDesktop(winTitle)
} else {
Run(command)
} |
Hello, Would it be possible to also add a version of MoveWindowToCurrentDesktop which supports PID ?
Right now this seems to only work with window titles. |
VD.MoveWindowToCurrentDesktop("ahk_pid" PID)
WinActivate("ahk_pid" PID) does this code work for you ? if yes, I don't know what you're asking, because this is by PID
if (VD.getDesktopNumOfWindow("ahk_exe notepad.exe")!==VD.getCurrentDesktopNum()) {
VD.MoveWindowToCurrentDesktop("ahk_exe notepad.exe")
} do you really need PID when you can use ahk_exe ? |
You're right, works fine with ahk_exe 👍 Thanks for suggestion and VD.ahk |
I've somehow overlooked both options. Works perfectly. Thanks! |
Use case: It would be great to have a hotkey which checks whether a specific app (window) is open in any Virtual Desktop, and if it is, activates it in its already-existing desktop. If it does not yet exist, I would open it in the current desktop, but YMMV. Thanks! (Win 11)
The text was updated successfully, but these errors were encountered: