Jump to content

Recommended Posts

Posted (edited)

Short and sweet. Basically is there a way to window scroll your window X amount of pixels up or down?

Without: Spacebar, Down/Up arrows.

Looking for a cmd line to move a window by how many pixels

Edited by Asakor
  • Moderators
Posted

Asakor,

Welcome to the AutoIt forum. :huh2:

Look at _GUIScrollBars_ScrollWindow in the Help file. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Thanks for the warm welcome, and fast response.

I am very new to coding, only getting by on what I have taught myself.

From what I undertand, is that the WindowsScrolling on AutoIt doesnot go by pixels only by objects

What I am trying to do is move a webpage up (scroll) an exact amount up, then continue my coding.

In the Help Tool, I am getting lost in advance coding I dont really understand. Anyway where you can break it down for me?

Thanks again for the fast response and continued efforts :huh2:

  • Moderators
Posted

Asakor,

  Quote

WindowsScrolling on AutoIt doesnot go by pixels only by objects

True, but as far as I know it is a Windows limitation that only allows you to scroll GUIs in character height/width units - AutoIt uses the Windows API and so can do no more than Windows allows. :huh2:

Perhaps if you showed the code you have so far then we might be able to offer more relevant help. For example, if you are trying to automate controls on a webpage then there are other ways to do it than scrolling an exact number of pixels. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)

Posted Image

Dim $Running

$Running = True
HotKeySet ("{F1}", "Stop")


While ($Running = True)
WinWaitActive("4walled - Google Chrome","")
MouseClick("left",63,339,1)
;Center of 1st Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",195,339,1)
;Center of 2nd Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",327,339,1)
;Center of 3rd Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",459,339,1)
;Center of 4th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",591,339,1)
;Center of 5th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",723,339,1)
;Center of 6th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",855,339,1)
;Center of 7th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",987,339,1)
;Center of 8th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",1119,339,1)
;Center of 9th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",1251,339,1)
;Center of 10th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",1383,339,1)
;Center of 11th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")

WinWaitActive("4walled - Google Chrome","")
MouseClick("left",1515,339,1)
;Center of 12th Thumbnail
WinWaitActive("4walled","")
MouseClick("right",818,165,1)
MouseClick("left",864,294,1)
WinWaitActive("Save As","")
Send("{ENTER}")
WinWaitActive("4walled","")
Send("{CTRLDOWN}w{CTRLUP}")
WEnd

Func Stop ()
    $Running = False
    EndFunc

What I am doing is opening a thumbnail (yellow Circle) to a image that I am saving. Closing the tab, and going to the next thumbnail to the right. Once I complete the line of links (images) I want to move the webpage up and then restart the progress. Did a lot of photoshop to find out that the center of the first thumbnail to the center of the next (below) is 74px.

Edited by Asakor
  • Moderators
Posted

Asakor,

Alas, we have libraries to automate IE and FireFox, but not Chrome. ;)

I can only suggest that you click on the "down" arrow and see how many pixels that moves you. Once you know how far you move, a bit of maths should enable you to hit the next row down fair and square.

Sorry I cannot be of more help - I will try harder next time. :huh2:

m23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Down arrow 40px, the page would run out of px before it would reach a point where I would have to reset the px offset itself. I have Firefox, if I were to change a few line of command would I be golden for the libraries?

  • Moderators
Posted

Asakor,

I do not use FireFox myself. You could search for the FF.au3 library and see what it offers as functions or start a new thread to attract FireFox users. I would suggest a title like "Selecting images in FireFox webpage" - that should draw the knowledgeable forum members. :huh2:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...