Sign in to follow this  
Followers 0
mikezwet2

Press a Button

19 posts in this topic

#1 ·  Posted (edited)

Hello everyone,

I am new here and have made already some simple script.

Now i have to made a script that press a button in a file save menu. In AU3_Spy.exe i see "class: button2" . I dont know how to put this in a schript step.

Can somebody help me?

Greetings, Mike

Edited by mikezwet2

Share this post


Link to post
Share on other sites



Hello everyone,

I am new here and have made already some simple script.

Now i have to made a script that press a button in a file save menu. In AU3_Spy.exe i see "class: button2" . I dont know how to put this in a schript step.

Can somebody help me?

Greetings, Mike

<{POST_SNAPBACK}>

Check the helpfile for ControlClick()

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I dont know how to do this  :"> so i made a screenshot, mayby you can explain what i have to fill in.

,Mike

<{POST_SNAPBACK}>

Iets als dit zou moeten werken (Something like this):

Opt("WinTitleMatchMode", 1) 
ControlClick ( "Records naar bestand", "", "Button2")

:idiot:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2)
$Title = "Records naar"
ControlClick($Title, "", "Button2")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Iets als dit zou moeten werken (Something like this):

Opt("WinTitleMatchMode", 1) 
ControlClick ( "Records naar bestand", "", "Button2")

:D

<{POST_SNAPBACK}>

It works great, but sometimes he dont put's the file just anywere on the computer, how can i set a location, by example c:/export ?

What's the "WinTitleMatchMode" in this line?

Dank u wel :idiot:

Edited by mikezwet2

Share this post


Link to post
Share on other sites

It works great, but sometimes he dont put's the file just anywere on the computer, how can i set a location, by example c:/export ?

<{POST_SNAPBACK}>

Just fill the whole path + filename in the bestandnaam field.

What's the "WinTitleMatchMode" in this line?

Dank u wel  :idiot:

<{POST_SNAPBACK}>

WinTitleMatchMode Alters the method that is used to match window titles during search operations.

1 = Match the title from the start (default)

2 = Match any substring in the title

3 = Exact title match

4 = Advanced mode, see Window Titles & Text (Advanced) 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Just fill the whole path + filename in the bestandnaam field.

<{POST_SNAPBACK}>

That was a little change in my database but it works now.

I only get sometimes the message "want to overwrite" with yes or no option: The solution is to add an extra

Opt("WinTitleMatchMode", 1) 
ControlClick ( "Records naar bestand", "", "Button1")

Or a if formula, but here it comes, i dont know how to insert that..... :idiot:

If message overwrite > 
Opt("WinTitleMatchMode", 1) 
ControlClick ( "Records naar bestand", "", "Button1") 
else
verder gaan met script
Edited by mikezwet2

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Mike, i don't know how the extra question thing looks and if its a seperate window, but the best thing for optional text boxes is to add an adlib function.

Something like:

Opt("WinTitleMatchMode", 1) 
AdlibEnable("extra_Windows")
; do you stuff filling in the window
; click to button
ControlClick ( "Records naar bestand", "", "Button1") 
AdlibDisable()
; do the rest

Func extra_Windows()
   If WinExists("Whatever the title is of the window", "Text to make it unique") then
      ControlClick ("Whatever the title is of the window", "Text to make it unique", "Button1") 
   EndIf
EndFunc
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ask a plain vanilla question that can be answered from the help file and people will chew your ARSE

but post a picture of a windows DESKTOP from AMSTERDAM and help comes your way.

(I too was mesmerized by the wording on the windows dialog so had to reply

even if I am not adding anything to the answer)

Vanille is afkomstig uit peulen die groeien aan een plant die behoort tot de orchideeënfamilie.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Alright, i have to make a folder under c:

I can use the

DirCreate ( "path" )

but it has to be a name, this name, exally the whole path is on my clipbord, so it can be a message where i can paste the path in and click ok. Is this possible?

if not i can use the code as on top and always use the same folder. Not varible

Edited by mikezwet2

Share this post


Link to post
Share on other sites

ClipGet() will get the clipboard contents...

DirCreate(ClipGet())

I apologize if I don't understand the goal...

Lar.

<{POST_SNAPBACK}>

It works, i have made the following code and have in the clipbord the path: C:\DVDCollectie15\lijsttab.tab

FileOpen(ClipGet())
Send ("^a")
Send ("^c")
WinActivate("FileMaker Developer", "")
WinClose("lijsttab.tab - Kladblok", "")
Exit

I get a failmessage in line 0: Fileopen(clipget())

error: incorrect number of parameters in function call.

I dont know what's wrong?

Share this post


Link to post
Share on other sites

It works, i have made the following code and have in the clipbord the path: C:\DVDCollectie15\lijsttab.tab

FileOpen(ClipGet())
Send ("^a")
Send ("^c")
WinActivate("FileMaker Developer", "")
WinClose("lijsttab.tab - Kladblok", "")
Exit

I get a failmessage in line 0: Fileopen(clipget())

error: incorrect number of parameters in function call.

I dont know what's wrong?

<{POST_SNAPBACK}>

FileOpen has 2 parameter;

FileOpen ( "filename", mode )

You have 1...... :idiot:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

FileOpen has 2 parameter;

FileOpen ( "filename", mode )

You have 1...... :idiot:

<{POST_SNAPBACK}>

Sorry :">

I have add that and, the path "C:\DVDCollectie15\lijsttab.tab" is in my clipbord.

Then i call up the script, this one must:

Open the file, C:\DVDCollectie15\lijsttab.tab

Select all text

Copy this selected tekst

Close the file lijsttab.tab

Return to Filemaker developer

exit script

Filemaker pro paste the copied text into a field.

This is my script:

FileOpen(ClipGet(), 0)
Send ("^a")
Send ("^c")
WinClose("lijsttab.tab - Kladblok", "")
WinActivate("FileMaker Developer", "")
Exit

The thing he do now is select al items in folder where the exe is in.

Also i try to put this line as second step:

WinWaitActive("lijsttab.tab - Kladblok")

Still not working but when i open lijsttab.tab manual the script takes over and it works

So i think the error is in the first line,

Whats wrong in the eyes of a professional? :D

Edited by mikezwet2

Share this post


Link to post
Share on other sites

So i think the error is in the first line,

Whats wrong in the eyes of a professional?  :idiot:

<{POST_SNAPBACK}>

FileOpen opens a file so you can read its records with FileRead or FileReadLine..

Don't know what the

Send ("^a") ; select all

Send ("^c") ; copy

are doing here in your script ????????


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I did it with another way:

Run("notepad.exe")
WinWaitActive("Naamloos - Kladblok")
Send ("^o")
WinActivate("Openen")
Send ("^v")   ; paste the path and filename from clipbord

Opt("WinTitleMatchMode", 1) 
ControlClick ( "Openen", "", "Button2") 

Send ("^a")
Send ("^c")
WinClose("lijsttab.tab", "")
WinActivate("FileMaker Developer", "")
WinWaitActive("FileMaker Developer")
Send ("^v"); paste all selected text from lijsttab.tab to filemaker database field
Exit

This works really great, the only problem is when somebody use a english language windows version. I think there a way's to fix this like:

If oslanguage = dutch

....

...

else

....

....

But that's to mutch for me at this time.

I LIKE AUTOIT script :idiot:

Edited by mikezwet2

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Check @OSLang macro values and use a select case.

E.g.

Select 
   Case @OSLang = 1009;English_Canadian
     ;
   Case @OSLang = 042f;Macedonian
     ;
   Case @OSLang = 0406;Danish
     ;
   Case Else
     ;Unknow language.
EndSelect
Edited by ezzetabi

Share this post


Link to post
Share on other sites

This works really great, the only problem is when somebody use a english language windows version. I think there a way's to fix this like:

I LIKE AUTOIT script  :idiot:

<{POST_SNAPBACK}>

You could use the classname which i presume is the same in all languages:

Opt("WinTitleMatchMode", 4) 
Run("notepad.exe")
WinWaitActive("classname=Notepad")

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You could use the classname which i presume is the same in all languages:

Opt("WinTitleMatchMode", 4) 
Run("notepad.exe")
WinWaitActive("classname=Notepad")

<{POST_SNAPBACK}>

Use the classname is a good option i think,

The whole process i made works, but when its ends (al database steps are done) there's one script still in the background waiting for a window, when i open it the script ends.

Is it dangerous to leave this script on the back? or is there a way to close it.

One more time, i dont know how its possible that it is still running, it has and exit step at the end.

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