Sign in to follow this  
Followers 0
mikezwet2

When/if message then controlclick

12 posts in this topic

Hi everyone,

I got the following code:

WinActivate("Export Field to File")
Send("^v") 
WinWaitActive("Export Field to File")
Opt("WinTitleMatchMode", 2) 
ControlClick ( "Export Field to File", "", "Button2") 
Exit

I want the script checks first if the message "filemakerpro" comes up, if that's true he must click on OK (button2).

How looks the code for this?

Share this post


Link to post
Share on other sites



Hi everyone,

I got the following code:

WinActivate("Export Field to File")
Send("^v") 
WinWaitActive("Export Field to File")
Opt("WinTitleMatchMode", 2) 
ControlClick ( "Export Field to File", "", "Button2") 
Exit

I want the script checks first if the message "filemakerpro" comes up, if that's true he must click on OK (button2).

How looks the code for this?

<{POST_SNAPBACK}>

If WinExists("filemakerpro","",60) then
    ControlClick("","","Button2")
Endif

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Alright, i was thinking to difficult.

What means 60 in this winexists function?

<{POST_SNAPBACK}>

Timeout value. Check the help file. :lmao:

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

WinActivate("Export Field to File")
Send("^v") 
WinWaitActive("Export Field to File")
Opt("WinTitleMatchMode", 2) 
ControlClick ( "Export Field to File", "", "Button2") 

If WinWaitActive("FileMaker Pro","",60) then
    ControlClick("","","Button1")
Endif   

If WinWaitActive("FileMaker Pro","",60) then
    ControlClick("","","Button1")
Endif

Exit

The script don't close when the screen "FileMaker Pro" not comes up, the script is in a loop so i have a lot open scripts. i need something like

else close if ?

Edited by mikezwet2

Share this post


Link to post
Share on other sites

WinActivate("Export Field to File")
Send("^v") 
WinWaitActive("Export Field to File")
Opt("WinTitleMatchMode", 2) 
ControlClick ( "Export Field to File", "", "Button2") 

If WinWaitActive("FileMaker Pro","",60) then
    ControlClick("","","Button1")
Endif   

If WinWaitActive("FileMaker Pro","",60) then
    ControlClick("","","Button1")
Endif

Exit

The script don't close when the screen "FileMaker Pro" not comes up, the script is in a loop so i have a lot open scripts. i need something like

else close if ?

<{POST_SNAPBACK}>

Read the help file on "ControlClick" You have to specify the window name or handle to send the control click to.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Opt("TrayIconDebug", 1); Curser on systray icon will give current script line.

WinWait("Export Field to File")
WinActivate("Export Field to File")
Send("^v") 
Opt("WinTitleMatchMode", 2)

If WinWaitActive("Export Field to File") Then
    ControlClick ( "Export Field to File", "", "Button2")
EndIf

If WinWaitActive("FileMaker Pro","") then
    ControlClick("FileMaker Pro","","Button1")
Endif   

If WinWaitActive("FileMaker Pro","") then
    ControlClick("FileMaker Pro","","Button1")
Endif

Exit

TrayIconDebug option may help to know which line is a problem. The winwait added may help also? Oh, titles in ControlClicks, added, would be good also.

:lmao:

Share this post


Link to post
Share on other sites

Opt("TrayIconDebug", 1); Curser on systray icon will give current script line.

WinWait("Export Field to File")
WinActivate("Export Field to File")
Send("^v") 
Opt("WinTitleMatchMode", 2)

If WinWaitActive("Export Field to File") Then
    ControlClick ( "Export Field to File", "", "Button2")
EndIf

If WinWaitActive("FileMaker Pro","") then
    ControlClick("FileMaker Pro","","Button1")
Endif    

If WinWaitActive("FileMaker Pro","") then
    ControlClick("FileMaker Pro","","Button1")
Endif

Exit

TrayIconDebug option may help to know which line is a problem. The winwait added may help also? Oh, titles in ControlClicks, added, would be good also.

:lmao:

<{POST_SNAPBACK}>

I know the problem: the script waits until the message with title "FileMaker pro" appaers. When is don't appear the script is not closing.

How can i go further with the script if the message "FileMaker pro" not appears?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Opt("TrayIconDebug", 1); Curser on systray icon will give current script line.

AdlibEnable("_Extra_Window", 500); if the message "FileMaker pro" does appear.

WinWait("Export Field to File")
WinActivate("Export Field to File")
Send("^v") 
Opt("WinTitleMatchMode", 2)

If WinWaitActive("Export Field to File") Then
    ControlClick ( "Export Field to File", "", "Button2")
EndIf

Func _Extra_Window(); Adlib nominated function
    If WinExists("FileMaker Pro","") then
        ControlClick("FileMaker Pro","","Button1")
    Endif
EndFunc

Exit

Perhaps an adlibenable may help then. It is set, as shown, to check every half second, for Filemaker window.

Edit: Changed winwait to winexists. :">

Edited by MHz

Share this post


Link to post
Share on other sites

Opt("TrayIconDebug", 1); Curser on systray icon will give current script line.

AdlibEnable("_Extra_Window", 500); if the message "FileMaker pro" does appear.

WinWait("Export Field to File")
WinActivate("Export Field to File")
Send("^v") 
Opt("WinTitleMatchMode", 2)

If WinWaitActive("Export Field to File") Then
    ControlClick ( "Export Field to File", "", "Button2")
EndIf

Func _Extra_Window(); Adlib nominated function
    If WinExists("FileMaker Pro","") then
        ControlClick("FileMaker Pro","","Button1")
    Endif
EndFunc

Exit

Perhaps an adlibenable may help then. It is set, as shown, to check every half second, for Filemaker window.

Edit: Changed winwait to winexists.  :">

<{POST_SNAPBACK}>

It works, but... the script doesn't click on the message "FileMaker Pro" when it appears

Share this post


Link to post
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
Sign in to follow this  
Followers 0