Take the 2-minute tour ×

I've got a AHK script that looks for an active Emacs window and switches to it. However, since I'm using VirtuaWin now, this script stopped working -- it only works on the virtual display where Emacs actually is, but not on others. Any suggestions on what I can do?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted
DetectHiddenWindows, on

would detect it, but switching to the workspace it's on could be complicated.

share|improve this answer
Thanks, it actually works. The window is switched to, but it's also moved to current desktop. This I can live with ;) –  Nikolai Prokoschenko Sep 1 '09 at 11:58
ooh, better than I expected :D –  Phoshi Sep 1 '09 at 12:08
add comment

Old question, but in case anyone else stumbles upon it, if you always run Emacs (or whatever other application) on a specific desktop, you can use VirtuaWin's command line interface to switch desktops. Here's a snippet from my autohotkey.ahk to switch to desktop 5 and find or run visual studio:

    run c:\program files (x86)\VirtuaWin\VirtuaWin.exe -msg 1034 5
    sleep, 100
    SetTitleMatchMode, 2
    IfWinExist Microsoft Visual Studio

A brief sleep is needed after the window switch or WinExist won't find it.

A list of all of the VirtuaWin msg commands is in the VirtuaWin help file, Advanced User Guide / External Interface.

Hope it helps.

share|improve this answer
add comment

Your Answer


