However, WinGetTitle without () when nested inside the InStr() function, throws this warning.
code:
Code: Select all
#SingleInstance
SetTitleMatchMode( "Regex" )
#Space::
{
MinimizeIt( "autohotkey",
"youtube",
"google play music",
"gmail",
"discord" )
}
MinimizeIt( WinTitleList* ){
for title in WinTitleList
if ( WinExist( "i)" title ) )
{
if ( InStr( WinGetTitle, "Google Chrome" ) )
{
WinActivate
while ( InStr( WinGetTitle( "A" ), "autohotkey" )
|| InStr( WinGetTitle( "A" ), "youtube" )
|| InStr( WinGetTitle( "A" ), "gmail" )
|| InStr( WinGetTitle( "A" ), "google play music" ) )
{
Send( "^{Tab}" )
Sleep( 50 )
}
}
else
WinMinimize
}
}

Changing WinGetTitle to WinGetTitle() resolved this warning. I'm often confused to when the () is and is not needed when using functions and methods in AHK. seems that generally adding the () is the most reliable, however I would like to know when it is okay to omit the () and when it is not okay. If any one has pointers on this would be much apprecaited.
thanks for reading (*: