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?

2 Answers 2

3
DetectHiddenWindows, on

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

2
  • Thanks, it actually works. The window is switched to, but it's also moved to current desktop. This I can live with ;) Sep 1, 2009 at 11:58
  • ooh, better than I expected :D
    – Phoshi
    Sep 1, 2009 at 12:08
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .