and I have a code like this.
Code: Select all
!a::
run C:\Users\Westlife\Downloads\autohotkey\text.txt, , max
return
so if I press hotkey alt + a , the OS opens text.txt file in akelpad.(akelpad is already set as default txt opening application)
it works with no problem, but I want to go one step further for convenience which is:
If the text.txt file is already open(I mean exist, no matter if it is focused or not), the same hotkey should activate akelpad and show the text.txt file tab.
in this case, the following code doesn't work because it activates editor's last opened tab. not good.
Code: Select all
!a::
ifwinexist, ahk_class AkelPad4
winactivate, ahk_class AkelPad4
else
run C:\Users\Westlife\Downloads\autohotkey\text.txt, , max
return
Code: Select all
!a::
ifwinexist, AkelPad - [C:\Users\Westlife\Downloads\autohotkey\text.txt]
winactivate, AkelPad - [C:\Users\Westlife\Downloads\autohotkey\text.txt]
else
run c:\users\westlife\downloads\autohotkey\text.txt, , max
return
is there something like iftabexist or tabactivate ( I guess not), or anything that does the same thing or workaround?
thx, regard.