3

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?

Kyle Strand
  • 1,916

2 Answers2

3
DetectHiddenWindows, on

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

Phoshi
  • 23,483
0

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:

#V::
    run c:\program files (x86)\VirtuaWin\VirtuaWin.exe -msg 1034 5
    sleep, 100
    SetTitleMatchMode, 2
    IfWinExist Microsoft Visual Studio
        WinActivate
    else
        Run C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
    return

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.