Incommodious Posted November 16, 2012 Share Posted November 16, 2012 How do you make a script select a certain application window and only click in that window no matter where the window is on your screen? Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 16, 2012 Share Posted November 16, 2012 Have a look at the FindWindow routines: [sCAR]var NewClient: TSCARWindowClient; begin NewClient := TSCARWindowClient.Create(FindWindowEx('Title of Window to search for', False, True)); SetClient(NewClient).Free(); NewClient.Activate(); end.[/sCAR] Quote Link to comment Share on other sites More sharing options...
Incommodious Posted November 16, 2012 Author Share Posted November 16, 2012 Unknown identifier 'FindWindowEx' Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 16, 2012 Share Posted November 16, 2012 (edited) You must use the OSI include. Install it from File->Includes Manager Replace 'Title of the window to search for' With the window you want to come into view Read the beginner tut I showed you and look at the sections about Clients Then run this script: [scar] {$I OSI/OSI.scar} var NewClient: TSCARWindowClient; begin NewClient := TSCARWindowClient.Create(FindWindowEx('Title of Window to search for', False, True)); SetClient(NewClient).Free(); NewClient.Activate(); // Then you can do your mouse events wait(1000); // wait a second MoveMouse(0, 0); end. [/scar] Edited November 16, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
Incommodious Posted November 16, 2012 Author Share Posted November 16, 2012 Ive seen a 20 part tut on youtube and read 2 other tuts online about scripts and somehow i guess i dont understand haha but yeah ill look at that. Shouldnt i just install all the Includes? Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 16, 2012 Share Posted November 16, 2012 Ive seen a 20 part tut on youtube and read 2 other tuts online about scripts and somehow i guess i dont understand haha but yeah ill look at that. Shouldnt i just install all the Includes? Nah, because you might not use them all. Its up to you though. SCAR has many functions, and much are undocumented. But a lot have been documented and are available here - wiki.scar-divi.com Some: ClickMouse MoveMouse PressVKey VKeyDown PressKey KeyDown KeyUp VKeyUp and more and more. GetColor FindColor FindColorTol (Find a color with a tolerance - meaning find said color and if there is a similar color to it maybe (5) away it will find that one if it cant find the original) Repeat, if, for, case, types, objects, and much more you can learn... Quote Link to comment Share on other sites More sharing options...
Incommodious Posted November 16, 2012 Author Share Posted November 16, 2012 If i wanted my entire script to be in one client would i put that code before everything els Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 16, 2012 Share Posted November 16, 2012 Yes, you need to decide what your client is (window), before you can make all actions be within that window. At least with SCAR anyway. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 16, 2012 Share Posted November 16, 2012 Of course if you knew what the window is ahead of time you could simply drag SCAR's crosshairs onto the client ahead of time and have the client already selected when you start your script. Quote Link to comment Share on other sites More sharing options...
Incommodious Posted November 16, 2012 Author Share Posted November 16, 2012 I always drag the crosshairs onto the client i use but if the client is say not where it is when you first open it say like on my 2nd monitor, it usually wont work but sometimes will Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 16, 2012 Share Posted November 16, 2012 You can use GetClient.Activate; in your script to bring the window you selected with SCAR's crosshairs to focus & in front of the other windows you have open. Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 16, 2012 Share Posted November 16, 2012 Unknown identifier 'FindWindowEx' Bixby misspelled the functionname, it's [wiki=FindWindowsEx]FindWindowsEx[/wiki] Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 16, 2012 Share Posted November 16, 2012 Bixby misspelled the functionname, it's [wiki=FindWindowsEx]FindWindowsEx[/wiki]My bad. Quote Link to comment Share on other sites More sharing options...