gironhimo

Scripte funktionieren nicht Win10

7 posts in this topic

#1 ·  Posted (edited)

Hallo,

ich würde gerne ein Script erstellen welches simpel einen Button klickt, aber es funktioniert trotz zahlreicher Beispiele nicht.

Ich habe sogar Beispielscripte original 1 zu 1 übernommen, doch auch diese funktionieren nicht.

 

Trans: I would like to create a script which simply clicks a button, but it does not work despite numerous examples.

I have even taken sample scripts original 1 to 1, but also these do not work.

Edited by Melba23
Added translation

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hallo,

ich würde gerne ein Script erstellen welches simpel einen Button klickt, aber es funktioniert trotz zahlreicher Beispiele nicht.

Ich habe sogar Beispielscripte original 1 zu 1 übernommen, doch auch diese funktionieren nicht.

Selbst die einfachen Notepad Scripte funktionieren absolut nicht, Weder Maus Clicks noch Send. Ich habe absolut keine Ahnung, warum selbst die einfachsten Scripte nicht funktionieren.

Gibt es vielleicht generell ein Problem mit Win10 oder was mache ich falsch, das keine Scripte anziehen.

Zwar öffnen sich Programmewenn ich diese mit Run oder Shell execute aufrufe, aber ControlClicks bzw Send commands funktionieren nicht.

 

Trans: I would like to create a script which simply clicks a button, but it does not work despite numerous examples.

I have even taken sample scripts original 1 to 1, but also these do not work.

Even the simple notepad scripts do not work absolutely, neither mouse clicks nor send. I have absolutely no idea why even the simplest scripts do not work.

Is there generally a problem with Win10 or what I do wrong, which do not attract scripts.

Although open programs when I run these with Run or Shell execute, but ControlClicks or Send commands do not work.

ShellExecute(@ScriptDir&"\Ninite.exe")


#While 1
#    WinSetTrans ( "Preparing", "", 0 )
#    WinSetTrans ( "Ninite", "", 0 )
#    $text = WinGetText("Ninite", "")
#    If StringInStr($text, "Finished.",1) Then
#        ExitLoop
#    EndIf
#    Sleep(500)
#WEnd

Sleep(1000)
ControlClick("Ninite", "", "[CLASS:Button; TEXT:Close; INSTANCE:1]")
ControlClick("Ninite", "", "[ID:2]")

 

Edited by Melba23
Added translation and code tags

Share this post


Link to post
Share on other sites

#3 ·  Posted

gironhimo,

This is an English-speaking forum - please use a translation site if you are concerned about your own language skills.

Please post the code you have been trying (see here how to do it) so we can try and spot the problem.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hello,

I try to use to buils a script under Win10 but without any succsess and i have absolut no idea why. I have try to use sample scripts for Notepad but nothing works, no control click no send.

Even given ample notepad scripts doesn't work. I can start programs with run or shellexecute command but i am not able to send message/text or control click command and i don't understand. Is it a problem with win10 build 1703 or what can be the reason for that ?

 

Here an excample for a script which i need to use.

 

ShellExecute(@ScriptDir&"\Ninite.exe")


While 1
    WinSetTrans ( "Preparing", "", 0 )
    WinSetTrans ( "Ninite", "", 0 )
    $text = WinGetText("Ninite", "")
    If StringInStr($text, "Finished.",1) Then
        ExitLoop
    EndIf
    Sleep(500)
WEnd

Sleep(1000)
#ControlClick("Ninite", "", "[CLASS:Button; TEXT:Close; INSTANCE:1]")
ControlClick("Ninite", "", "[ID:2]")

 

Edited by Melba23
Added code tags

Share this post


Link to post
Share on other sites

#5 ·  Posted

Are you sure the titles are from the beginning? The default window title match mode is a string starting from the beginning of the title. If you want to match any substring of the title, you can put

Opt("WinTitleMatchMode", 1)

at the top of your script.


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

#6 ·  Posted

6 hours ago, gironhimo said:

Hello,

I try to use to buils a script under Win10 but without any succsess and i have absolut no idea why. I have try to use sample scripts for Notepad but nothing works, no control click no send.

Even given ample notepad scripts doesn't work. I can start programs with run or shellexecute command but i am not able to send message/text or control click command and i don't understand. Is it a problem with win10 build 1703 or what can be the reason for that ?

 

Here an excample for a script which i need to use.

 

ShellExecute(@ScriptDir&"\Ninite.exe")


While 1
    WinSetTrans ( "Preparing", "", 0 )
    WinSetTrans ( "Ninite", "", 0 )
    $text = WinGetText("Ninite", "")
    If StringInStr($text, "Finished.",1) Then
        ExitLoop
    EndIf
    Sleep(500)
WEnd

Sleep(1000)
#ControlClick("Ninite", "", "[CLASS:Button; TEXT:Close; INSTANCE:1]")
ControlClick("Ninite", "", "[ID:2]")

 

It looks like you are trying to run a ninite installer.  The way the script is written is very...odd.  Why would you put the WinSetTrans inside the while loop?  Try this:

#RequireAdmin
ShellExecute ( @ScriptDir & "\ninite.exe" )
$win = WinWait ( "Ninite" )
WinSetTrans ( $win, "", 0 )
Do
    Sleep ( 300 )
Until WinExists ( "Ninite", "Close" )
WinActivate ( "Ninite", "Close" )
WinWaitActive ( "Ninite", "Close" )
ControlClick ( "Ninite", "Close", 2 )

 

Share this post


Link to post
Share on other sites

#7 ·  Posted

Oh, I didn't even notice he was missing #RequireAdmin. That is definitely the reason he was not able to click the controls.


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

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