AHK and dexpot

Post any technical problems or questions you have while using or configuring Dexpot.
Bug-Tracker
akilem
Posts: 1
Joined: 03.06.2013 11:19:50

AHK and dexpot

Postby akilem » 03.06.2013 11:46:02

Hello,

Dexpot is an incredieble piece of software. It radiccaly changes the way I work. So many thanks to support it and continue to develop it.

An another incredible software I use is AHK (AutoHotKey) which is a scripting language I use to automate a lot of tasks and provide a better experience in Windows.

One thing I would like to achieve is to test if a window is actually present in a virtual desktop ? Does anybody have some direction to search for a solution ?

For example, if Chrome/Explorer... is present in the wirtual desktop add a new tab, if not start a new instance of the program (and live it is the others virtual desktop).

Many thanks,

Noesis
Posts: 9
Joined: 07.05.2013 15:26:48

Re: AHK and dexpot

Postby Noesis » 05.06.2013 04:29:48

This is an example of a script I use for Firefox hopefully it will help. Keep in mind however that things may work differently depending on how you have the windows set up in Dexpot.

NB: In this example, I've got firefox set up in dexpot's "mywechsel.ini" in the [Exe] section as "firefox.exe=move", hence the else if statement is never actually used in the following script but I left it in there so I'd know what to expect for other scripts.

Code: Select all

; Activates the Firefox window or opens the program if no window exists
SetTitleMatchMode 2
if WinExist("- Mozilla Firefox ahk_class MozillaWindowClass") ;only true if win on current Dexpot Desktop unless "move" is used in the mywechsel.ini
   WinActivate, - Mozilla Firefox ahk_class MozillaWindowClass
else if WinExist( "ahk_exe firefox.exe") ;will be true no matter what Dexpot Desktop Window is on
   WinShow - Mozilla Firefox ahk_class MozillaWindowClass ;Copies the window
else
   Run, C:\Program Files (x86)\Mozilla Firefox\firefox.exe
SetTitleMatchMode 1
exit


Hope this is of some help.

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: AHK and dexpot

Postby Patrick » 06.06.2013 17:26:29

:dex:

Here is another example that gives you a list of all Chrome windows on the current desktop. Should work with any Dexpot settings.

Code: Select all

WinGet, windows, List, ahk_class Chrome_WidgetWin_1
Loop %windows% {
   hWnd := windows%A_Index%
   WinGet, style, Style, ahk_id %hWnd%
   WinGet, exstyle, ExStyle, ahk_id %hWnd%
   if((style & 0x10000000) <> 0 AND (exstyle & 0x08000000) = 0) {
      WinGetTitle, title, ahk_id %hWnd%
      MsgBox %title%
   }
}


Return to “Support”

Who is online

Users browsing this forum: No registered users and 205 guests