MasonMill Posted April 19, 2010 Posted April 19, 2010 Hi guys, I am very familiar with pixel search, as i use it all the time altering my desktop stuff. I quite enjoy it actually, its great. I have a question though. So if i have a desktop icon, i want to throw it in the trash bin. If i dont know the color that it will be, but i know the color of the desktop background, how do i find the icons? Here is how i would do it if i knew the colors. while 1 $Desktop_Icon = PixelSearch(618, 68, 929, 299, 0xAB1A00, 10) If IsArray($Desktop_Icon) then MouseClickDrag("left", $Desktop_Icon[0], $Desktop_Icon[1],400 , 200, 1) ;400,200 is my trash bin sleep(50) EndIf WEnd I know what you are all thinking, that it would be much easier doing it other ways, but i like tinkering with the pixelsearch. Thanks guys!
MasonMill Posted April 19, 2010 Author Posted April 19, 2010 So is there no way of doing it? Like say if some part of the background ISNT that color, then do something?
czardas Posted April 19, 2010 Posted April 19, 2010 I haven't tried this, but from the help file - Failure: Sets @error to 1 if color is not found. So perhaps you can adjust the coordinates of the previous successful search to get the icon coordinates, and drag from there. Otherwise I don't know! However it sounds like a very unpredictable method of cleaning up your desktop. Are you sure that's what you are trying to do? I would advise against it: Things could easily go wrong. operator64 ArrayWorkshop
MasonMill Posted April 20, 2010 Author Posted April 20, 2010 Thats the problem, is that there wont be an error due to the background being there. I guess there is no way of doing like a reverse pixel search such that if a color is there other than the one your looking for you get a response?
jaberwacky Posted April 20, 2010 Posted April 20, 2010 Could you use FileListToArray(@desktopdir) and then go by the name of the file? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
MasonMill Posted April 20, 2010 Author Posted April 20, 2010 Well im just exploring the techniques of pixelsearch, I don't want to do anything with files.
MasonMill Posted April 20, 2010 Author Posted April 20, 2010 maybe get all pixel colors of desktop and say if not those then drag?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now