Jump to content

^c Don't works fine


Recommended Posts

Hi to all, i'm new to this language and i can't solve this problem (i've seen help files and old topic in forum but no solved my problem).

I have this code:

Global  $tenChuongTrinh =   "Extractor Studio IT - Versione Freeware"
WinSetState ($tenChuongTrinh,"",@SW_MAXIMIZE)
WinSetOnTop ( $tenChuongTrinh, "", 1 )
Sleep(3000)
MouseMove(0.5*@DesktopWidth,0.376*@DesktopHeight)
MouseClick('left')
MouseClick('left')
Send("{HOME}")
$so_Lan_Lap =   ControlGetText($tenChuongTrinh, "", '[CLASS:Static; INSTANCE:21]')
FileDelete(@ScriptDir&'\text.txt')
For $i  =   1   To  $so_Lan_Lap Step + 1
    ClipPut("")
    Send("^c")
    Sleep(180)
    FileWriteLine(@ScriptDir&'\text.txt',ClipGet())
    Sleep(260)
    Send("{DOWN}")
Next

The command ^c sometimes works, sometimes it doesn't and the file text.txt is empty.

Is there another way to copy certainly the text?

Thank you

Immagine.jpg

Link to comment
Share on other sites

i dont know that program but why dont use controlgettext for the copy? or other things to get the text out of control

^c is so unsual and just should be used in emergency :D 

Edited by Aelc

why do i get garbage when i buy garbage bags? <_<

Link to comment
Share on other sites

Thanks of reply, i try ControlGetText but don't work (or i make error)

I try:

For $i  =   1   To  $so_Lan_Lap Step + 1
    ClipPut("")
    ;Send("^c")
    ControlGetText($tenChuongTrinh, "")
    Sleep(180)
    FileWriteLine(@ScriptDir&'\text.txt',ClipGet())
    Sleep(260)
    Send("{DOWN}")
Next

But don't works. Here the Info whene select listview.

Immagine2.jpg.fc21061a908c118bba2e61f595fe63d7.jpg

 

 

 

 

 

Immagine2.jpg

Link to comment
Share on other sites

You didnt callled the control where the text should be read from.

Controlgettext ( $tenChoungTrinh,"","RB_PANE7" )

Im not sure if it works because its a listview... maybe you have to delimiter the string after to get what you want

additionally you have to get this to a variable and insert it instead of clipget() like this

For $i  =   1   To  $so_Lan_Lap Step + 1
    $txt = ControlGetText($tenChuongTrinh, "","RB_PANE7")
    FileWriteLine(@ScriptDir&'\text.txt',$txt)
    Send("{DOWN}")
    Sleep(180)
Next

btw. would be easier if i would have installed the program :D 

Edited by Aelc

why do i get garbage when i buy garbage bags? <_<

Link to comment
Share on other sites

@Aelc

If you think that's a ListView control, just try to grab the handle of it and use _GUICtrlListView_* functions to see if you can manage with those :)

@CavaliereBianco

Waiting for someone to solve your problems is never a good practice, first because you are going to be still unable to solve your problems yourself, and second, this is a Forum where we help people with their own script.

Put some effort in solving your problem just to be grateful to yourself about what you have done.

Does it sound good, doesn't it? ;)

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

@FrancescoDiMuro yes i tried but couldnt make it work it was a bit creepy i have never seen before... they safed the data because you have to pay to export it i guess but you can copy it anyway...

i just could figure out a html code where i couldnt secure the raw data of the listview... i was hyped to finish it without Clipget :D 

 

anyway we got a solution by modifying his own script :) 

already done with PNs 

here the solution again:

WinActivate ( $tenChuongTrinh )
WinWaitActive ( $tenChuongTrinh )
$so_Lan_Lap =   ControlGetText($tenChuongTrinh, "", '[CLASS:Static; INSTANCE:21]')
FileDelete(@ScriptDir&'\text.txt')
ControlFocus ( $tenChuongTrinh, "",'[CLASS:RB_Pane; INSTANCE:7]' )
Send ("{CTRLDOWN}" )
For $i  =   1   To  $so_Lan_Lap Step + 1
    Send ( "c" )
    Sleep(30)
    Send("{DOWN}")
    FileWrite(@ScriptDir&'\text.txt',ClipGet() & @CRLF)
Next
Send ("{CTRLUP}" )

but you are right practice is necessary to improve :) 

Edited by Aelc

why do i get garbage when i buy garbage bags? <_<

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...