[Tutor] Pyautogui clicking on a modal pop-up dialog

Tim G. timothyg347 at gmail.com
Fri May 1 22:46:20 EDT 2020


Hey Jim,
There's a simple way to do that just get a screenshot of the ok button,
crop it down to just the button and then put it in the parenthesis. It
should look like pyautogui.click("button.png")
You can find a sample in the docs here:
https://pyautogui.readthedocs.io/en/latest/screenshot.html

On Wed, Apr 8, 2020 at 3:41 PM Jim <jf_byrnes at comcast.net> wrote:

> I am using OOSheet and Pyautogui to update a Libreoffice calc sheet.
>
> The following code snippet works until it hits the paste() function.
>
> cols_to_copy = copy_cellrange()
> # Copy the columns necessary to calculate the portfolios diversity
> colA = S(cols_to_copy[0]).copy()
> S('Diversification.R1').paste()
> pyautogui.click()
>
> Once I get to paste() it pops up a Libreoffice dialog warning me I am
> pasting into cells that contain data, do I want to paste. The cursor
> sits over the OK button but the click() never runs.
>
> Is there anyway to get Pyautogui to click the button?
>
> Thanks,  Jim
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list