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,
AHK and dexpot
Re: AHK and dexpot
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.
Hope this is of some help.
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.
Re: AHK and dexpot
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%
}
}
Who is online
Users browsing this forum: No registered users and 205 guests