Jump to content

Auto Clicking Button on PopUp


Recommended Posts

Hi All,

I've really been trying to figure this out myself and researching but I'm having no luck what so ever...

Basically, when Microsoft Powerpoint opens, a dialog is shown asking to either update links or cancel - I want to update links.

This is the code I have so far:

; Check if Powerpoint is running
If ProcessExists("powerpnt.exe") Then 
    Sleep(5000)
Else
    Run("C:\\scripts\\open.bat", "", @SW_HIDE)
    WinWait("Microsoft PowerPoint Security Notice")
    WinActivate("Microsoft PowerPoint Security Notice")
    ControlClick("Microsoft PowerPoint Security Notice", "", "", "", "", 260, 216)  
    EndIf

This is the Summary from the Window Info Tool:

>>>> Window <<<<
Title:  Microsoft PowerPoint Security Notice
Class:  NUIDialog
Position:   761, 394
Size:   398, 263
Style:  0x94C80000
ExStyle:    0x00000501
Handle: 0x00000000000D11B2

>>>> Control <<<<
Class:  NetUIHWND
Instance:   1
ClassnameNN:    NetUIHWND1
Name:   
Advanced (Class):   [CLASS:NetUIHWND; INSTANCE:1]
ID: 
Text:   
Position:   0, 0
Size:   392, 234
ControlClick Coords:    260, 216
Style:  0x56000000
ExStyle:    0x00000000
Handle: 0x0000000000140B68

>>>> Mouse <<<<
Position:   1024, 636
Cursor ID:  0
Color:  0x330000

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<

I was trying to use the Control Click to click 260,216 as that is exactly in the middle of the 'Update Links' button.

Any ideas where I'm going wrong here?

Any and all help is really appreciated.

Thanks
Kyle

Link to comment
Share on other sites

What does Open.bat do?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Hi Inuno - I don't believe that is the Button info as when I put the Window Info tool over the buttons it only highlights the entire pop-up window and not the smaller buttons.

Open.bat simply starts a powerpoint presentation slide.

However guys I think I've solved this with a simpler method.

I just have open.bat start the presentaion then a combination of sleep and Send.

I used Send "U" to update the links - sleep a few seconds then send "{F5}" to put the presentation in fullscreen.

Finally I put the entire thing in a Function so it continously loops. The end user will now just update the excel file - run another batch script to kill powerpoint then this looped autoit script will automatically restart the presentation, update the links and display full screen (on a TV Screen).

Thanks for the help though guys.

Link to comment
Share on other sites

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Ah, I love such additional information :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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