StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 General Action Scripts
 Find a window by title and activate
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rob

USA
2573 Posts

Posted - 12/19/2011 :  09:44:37  Show Profile  Visit Rob's Homepage  Reply with Quote
This script will find the first window with the title "Release" and activate it. As you'll notice, the first action supports regular expressions, so passing in "Rel.*se" would match as well.

local iHandle = acFindWindowByTitleRegex("Release")
acActivateWindow(iHandle,0,0)

Rob

USA
2573 Posts

Posted - 12/23/2011 :  07:53:52  Show Profile  Visit Rob's Homepage  Reply with Quote
A conditional variation. If No window is matched, send WIN+R, type "notepad" and send the enter key.


local iHandle = acFindWindowByTitleRegex("Rel.*se")
if iHandle > 0 then
acActivateWindow(iHandle,0,0)
else
acSendKeys("{DELAY=50}@r")
acDelay(400)
acSendKeys("{DELAY=50}notepad~")
end
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000