Jump to content
Estimize

How to use selected text in autoit

Recommended Posts

Estimize

I have a program that automatically selects this bit of text and I need it to make a decision based on what this text is. For example here it is "2.18", if it shows this number I need it to repeat the function it just previously executed which is called Click_1(). Also if this value is something else for example "0.00" I need it to go onto the next function which is called Click_2. Any help is appreciated and if I missed any bits of info out which would help you answer my question just let me know. This decision also needs to be made outside of the functions Click_1/2 if possible. Thanks in advance

2.18.png

Share this post


Link to post
Share on other sites
computergroove
Local $Data, $NewData;variable placeholder for selected text

While 1; make a loop to keep the script running inefinately
    WinActive(name of your program);You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then
        Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
        Click_2()
        $Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Haven't tested this but it is how I would write what you are explaining.

  • Like 1

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Estimize
Local $Data, $NewData;variable placeholder for selected text

While 1; make a loop to keep the script running inefinately
    WinActive(name of your program);You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then
        Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
        Click_2()
        $Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Haven't tested this but it is how I would write what you are explaining.

If $NewData == 2.18 Then
        Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
        Click_2()
        $Data == $NewData
    EndIF

 

 

is this correct or should what i changed to 2.18 stay as $data  also thanks very much for the help

 

 

Edited by Estimize
misscode

Share this post


Link to post
Share on other sites
computergroove

It depends on what you want the script to do. Will it run forever? How many values will there be? The code I wrote is made to work forever. If you only want to check the number a few times then leave it at 2.18. Bottom line here is that you need to take what I wrote and test it and make changes and then test it. If you get stuck add more questions to this thread and we will help.


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Estimize

I am having trouble getting my code to recognise the second if statement any help? My code is shown belowproblems.thumb.png.7c75289e5ba64c4e3b2f7

 

Edited by Estimize
miss click

Share this post


Link to post
Share on other sites
computergroove

Can you copy and paste your code in a code window (its the <> symbols) rather than a blurry screen shot? Thy this. you can use msgbox to debug what is happening in your code to find out why it does not do what you want it to.

#include <MsgBoxConstants.au3>
HotKeySet("{F6}","Terminalte")

Local $Data = 2.18;stored value of what the selected text was as of the last check
Local $NewData;most current value of what is the selected text

Click_1();Run the function Click_1() when the script starts before the while loop

While 1; make a loop to keep the script running inefinately
    If WinExists("Function2") Then
        WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
        Sleep(250)
    Else
        MgBox(0,"Missing Window","Functions2 window is not running")
        Exit 0
    EndIf
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then;this value starts as 2.18 as declared by line 3
        Click_1()
        $Data = $NewData;Set $Data to 2.18 after Click_1() has been run
    EndIF
    If $NewData == 0.00 Then
        Click_2()
        $Data = $NewData;This will set $Data to 0.00
    EndIF
    If $NewData <> 2.18 and $NewData <> 0.00 Then
        MsgBox(0,"NewData Value not 2.18 or 0.00","The value of $NweData is neither 2.18 nor 0.00. The value of $NewData is: " & $NewData)
        Exit 0
    EndIf   
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Func Terminate()
    Exit 0
EndFunc

 

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Estimize
This is the funtions2.au3 page this shouldnt be like the rest of the code sorry
Func Click_1()
   Sleep (10000)
   MouseClick("left" , 863, 356) ;Click the X button
   sleep (250)
   MouseClick("left" , 1300, 186) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("1.16") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Func Click_2()
   Sleep (1000)
   MouseClick("left" , 863, 563) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("3.74") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

This is the mainbot.au3 page

#include <MsgBoxConstants.au3>
#include <Functions2.au3>


HotKeySet("{F6}", "_Terminate")
Local $Data, $NewData;variable placeholder for selected text

Click_1()

While 1; make a loop to keep the script running inefinately
    WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == 2.18 Then
       Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
       Click_2()
        $Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

 

Edited by Estimize

Share this post


Link to post
Share on other sites
Estimize

Can you copy and paste your code in a code window (its the <> symbols) rather than a blurry screen shot? Thy this. you can use msgbox to debug what is happening in your code to find out why it does not do what you want it to.

#include <MsgBoxConstants.au3>
HotKeySet("{F6}","Terminalte")

Local $Data = 2.18;stored value of what the selected text was as of the last check
Local $NewData;most current value of what is the selected text

Click_1();Run the function Click_1() when the script starts before the while loop

While 1; make a loop to keep the script running inefinately
    If WinExists("Function2") Then
        WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
        Sleep(250)
    Else
        MgBox(0,"Missing Window","Functions2 window is not running")
        Exit 0
    EndIf
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then;this value starts as 2.18 as declared by line 3
        Click_1()
        $Data = $NewData;Set $Data to 2.18 after Click_1() has been run
    EndIF
    If $NewData == 0.00 Then
        Click_2()
        $Data = $NewData;This will set $Data to 0.00
    EndIF
    If $NewData <> 2.18 and $NewData <> 0.00 Then
        MsgBox(0,"NewData Value not 2.18 or 0.00","The value of $NweData is neither 2.18 nor 0.00. The value of $NewData is: " & $NewData)
        Exit 0
    EndIf   
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Func Terminate()
    Exit 0
EndFunc

 

what are the last 11 lines for???

 

 

Share this post


Link to post
Share on other sites
computergroove
#include <MsgBoxConstants.au3>
HotKeySet("{F6}","Terminate")

Local $Data = 2.18;stored value of what the selected text was as of the last check
Local $NewData;most current value of what is the selected text

Click_1();Run the function Click_1() when the script starts before the while loop

While 1; make a loop to keep the script running inefinately
    If WinExists("Function2") Then
        WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
        Sleep(250)
    Else
        MgBox(0,"Missing Window","Functions2 window is not running")
        Exit 0
    EndIf
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then;this value starts as 2.18 as declared by line 3
        Click_1()
        $Data = $NewData;Set $Data to 2.18 after Click_1() has been run
    EndIF
    If $NewData == 0.00 Then
        Click_2()
        $Data = $NewData;This will set $Data to 0.00
    EndIF
    If $NewData <> 2.18 and $NewData <> 0.00 Then
        MsgBox(0,"NewData Value not 2.18 or 0.00","$NewData is neither 2.18 nor 0.00. The value of $NewData is: " & $NewData)
        Exit 0
    EndIf   
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click_1()
   Sleep (10000)
   MouseClick("left" , 863, 356) ;Click the X button
   sleep (250)
   MouseClick("left" , 1300, 186) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("1.16") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Func Click_2()
   Sleep (1000)
   MouseClick("left" , 863, 563) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("3.74") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Can you point them out for me? I am adding features to the code in the event that the selected text is neither 2.18 nor 0.00. Its optional and you can remove it if that will never happen.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Estimize

my code is now working and chooses call_1 or 2 appropriately and I renamed them to call because I felt it fitted it's purpose better. I used this

 

#include <MsgBoxConstants.au3>
#include <Functions2.au3>

HotKeySet("{F6}", "_Terminate")
Local $Data, $NewData;variable placeholder for selected text

Sleep (5000)

MouseClick ("right", 1260, 260)
Sleep (250)
MouseClick ("left", 1214, 485)
sleep (250)
Call_1()

While 1; make a loop to keep the script running inefinately
    WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == 2.18 Then
       Call_1()
        ;$Data = $NewData
     Else
       $NewData == 0.00
       Call_2()
       ;$Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
WEnd

 

Now I need it to go onto call _3 if the result of the If statement call_2 is also 0.00 but if the result of the call_3 statement is 7.31 I need it to start back at call_1. If you don't understand I can explain it better because I'm sure I missed some sort of detail out, also thanks for the help so far very much appreciated. Also there can only be two values (like here 0.00 or 2.18) as what the program is asking a question and there are basically two answers every time it asks the question and one will always be 0.00. If the answer is 0.00 it will always go onto the next function for example if I was on call_2 and the answer was 0.00 I need the program to go onto call_3 but if the answer was 7.31 it goes back to call_1. Best explanation I can give. As well as this the program cannot skip call_1/2/3/4 to get to call_5 it has to go through all the call_'s in numerical order until the answer which isn't 0.00 is given then we loop back to call_1

 

 

Edited by Estimize
more info needed

Share this post


Link to post
Share on other sites
computergroove

How many calls are there going to be? 5? What are the values that you want to call a click function on for these 5 calls? ie there will be click_1() = 2.18  click_2() = 0.00 click_3() =7.31 etc


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Estimize

there will be a max of 10 calls,  and you might have misunderstood, so the program executes call_1 then the result of call_1 which can either be 2.18 or 0.00 decides whether it will move onto call_2 or stay on call_1. the result of call_1 to move onto call_2 is 0.00 but if the result of call_1 is 2.18 then it just repeats call_1. So when it executes call_2 it gets a result back at the end of the function which is either 7.31 or 0.00 if the result is 0.00 it will move onto call_3 but if the result of call_2 was 7.31 then I need it to loop back to call_1 and repeat like that. the numbers are the least relevant bits I think. So if the result of call_1 and 2 and 3 was all 0.00 it moves onto call_4 and if the result of call_4 is  17.16 (that may change in future but it j=should be easily replaced) then the program loops back to call_1 and carries on from there, but if the result of call_4 is 0.00 then it needs to go onto call_5 and so on.

Share this post


Link to post
Share on other sites
computergroove

You need a while loop where you have 10 + if statements or you need a do while loop or possibly several nested if statements. Really the point of this forum is to help you understand the concept of what you want your script to do and be able to write and modify your own. Are you stuck? Where are you stuck?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Estimize

You need a while loop where you have 10 + if statements or you need a do while loop or possibly several nested if statements. Really the point of this forum is to help you understand the concept of what you want your script to do and be able to write and modify your own. Are you stuck? Where are you stuck?

The while loop is the bit of program I am stuck on.

 

 

Share this post


Link to post
Share on other sites
computergroove

See if you can wrap your mind around this. It would help me write more if the info you gave me was correct and complete. What would help me the most would look something like this:

1. 0.00 or 2.18

2. 0.00 or 7.13

3. 0.00 or ?

4. 0.00 or 17.16

There's  a pattern here. Find it. Manipulate it to work for you.

#include <Array.au3>

Function_1();call the main function when the program starts

Func Function1()
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 2.18 Then
            Action_1()
        EndIf
        If
            $NewData == 0.00 Then
            Function_2()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
WEnd
EndFunc

Func Function_2()
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 7.13 Then
            Action_1()
            Function_1()
        EndIf
        If
            $NewData == 0.00 Then
            Action_3()
            Function_3()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
    WEnd
EndFunc

Func Function_3()
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 17.16 Then
            Action_1()
            Function_1()
        EndIf
        If
            $NewData == 0.00 Then
            Action_4()
            Function_4()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
    WEnd
EndFunc

Func GetClipData();get the number copied to the clipboard and then the value declared as a variable
    WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
EndFunc     

Func Action_1()
   Sleep (10000)
   MouseClick("left" , 863, 356) ;Click the X button
   sleep (250)
   MouseClick("left" , 1300, 186) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("1.16") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Func Action_2()
   Sleep (1000)
   MouseClick("left" , 863, 563) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("3.74") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

 


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Estimize

Thanks so much, I'll try it out for a bit and then get back to you with my progress, really appreciated thanks.

Share this post


Link to post
Share on other sites
Estimize

what is the action_1 etc meant to represent?

 

 

Share this post


Link to post
Share on other sites
computergroove

Function_1 searches for the number 0.00 and 2.18 then it calls the function action_1 or function_2. 

Object oriented design

1. Get the number.(call the function GetClipData())

2. If the number is 0.00 then Call function_2. If the number is 2.18 run action_1 again. (The if statements in Function_1())

3. In function_2, get the number. If the number is 0.00 then call function_3. If the number is 7.18 then call function_1 (start over).(The if statements in function_2())

etc.

Look at the function_# as the sequence you were describing for the numbers you want to compare. ie Function_1 compares 0.00 and 2.18. Function_2 compares 0.00 and 7.18. Function_3 I was given missing information from you so I dont know what the comparison is. You would make Function_4 to compare 0.00 and 17.16.

 

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
computergroove

I think I made a mistake in the code above.

Func Function_1();Only the first function needs to use a while loop.
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 2.18 Then
            Action_1()
        EndIf
        If
            $NewData == 0.00 Then
            Function_2()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
    WEnd
EndFunc

Func Function_2()
    ;you might want to put a sleep here depending on how long it takes for the value to change    
        GetClipData();get the value of the number
        If $NewData == 2.18 Then
            Action_1();your click sequence
            Function_1();restart back at the top (Function_1())
        EndIf
        If
            $NewData == 0.00 Then
            Action_2();Do something because the value is 0.00
            Function_2();Go on to the next function
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
EndFunc

 

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
Skysnake

Are we on track for nested IF statements?  I wonder what the source data represents? And the fact that it can always only be one item from a set of predefined values?  Do these values always increment? Can a value reduce? What are the implications if a wrong choice is made?

Intriguing.


Skysnake

Why is the snake in the sky?

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

  • Similar Content

    • QaisBsharat
      By QaisBsharat
      Hello, 
      May i know how can i automation qt application?
      Using controlclick not mouse and positions
       
      Thanks
    • nooneclose
      By nooneclose
      Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. 
      I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. 
      Here is the bit of code where I am trying to change the email that was used from unread to read:
      Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc  
    • SharpDressedMan
      By SharpDressedMan
      Hello,
      Is there any way to check for validity of a pointer to a DllStruct ?
      In the above code, a DllStruct is created from an invalid pointer. How to prevent from doing this ?
      local $tStruct = DllStructCreate("int i") DllStructSetData($tStruct, "i", 123) local $pStruct = DllStructGetPtr($tStruct) $tStruct = 0 ; destroy DllStruct ==> $pStruct becomes invalid ; how to check here for validity of $pStruct and prevent from doing the following ? $tStruct = DllStructCreate("int i", $pStruct) ; create DllStruct from invalid pointer... MsgBox(0, @ScriptName, @error) ; displays '0' : invalid pointer is not detected by DllStructCreate() MsgBox(0, @ScriptName, IsDllStruct($tStruct)) ; displays '1' : tStruct is assumed as a valid DllStruct object, which is not Thanks for help
    • nooneclose
      By nooneclose
      I need to send a string of text to this popup and click on the ok button to save it.
      Here is the code I have so far:
      ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500)  
      Here is the popup:

    • yasha
      By yasha
      i want am trying to select a nimber to run a program and then select where to save the excel result at before hand
      the problem is that it does not save in the folder i want but the folder before any solutions
      #.................
      $sFolder = ""
          ; Create a constant variable in Local scope of the message to display in FileSelectFolder.
          Local Const $sMessage = "Select a folder"
          ; Display an open dialog to select a file.
          $sFileSelectFolder = FileSelectFolder($sMessage, $sFolder)
          If @error Then
              ; Display the error message.
              MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
          Else
              ; Display the selected folder.
              MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder)
          EndIf
      .......
      ........
      $oExcel = ObjCreate("Excel.Application")                   ; Create an Excel Object
      $oExcel.Visible = 1                                        ; Let Excel show itself
      $oExcel.Workbooks.Open("J:\OPS\OPS_Share\Planners\2 - Weekly Reports\Auto download\"& $YY & $MM & $DD & " ORDER.xls",0)
      $oExcel.ActiveWorkbook.Saveas ( $sFileSelectFolder,""& $YY & $MM & $DD & " ORDER.xlsx", 1)
      $oExcel.ActiveWorkBook.Close
      $oExcel.Quit
      i only want to save it as ddmmyy order inside documents but it saves in libraries as documents ddmmyy order.
×