Jump to content

Why wont this work?


 Share

Recommended Posts

-edit-

Oops, i didnt mean to set the title to something that wasnt informing!

#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Local $oIE = _IECreateEmbedded()
HotKeySet("{ENTER}", "GrabTranslateEnter")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 117, 27, 1112, 126, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
GUICtrlCreateObj($oIE, 32, 8, 33, 9)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_IENavigate($oIE, "http://www.albinoblacksheep.com/text/aoler")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

func GrabTranslateEnter()
$Test = WinGetHandle("Untitled - Notepad","")
$hDLL = DllOpen("user32.dll")
$GetText = ControlGetText($Test,"","Edit1")
;;;;;;;;;;;;;;;;;;;;;;;

Local $oQuery = _IEGetObjById($oIE, "translatethis")
_IEFormElementSetValue($oQuery, $GetText)
sleep(100)

$colTags = _IETagNameGetCollection($oIE, "input")
For $oTag In $colTags
; Might also work this way:
; If $oTag.value = "Release" Then
If _IEPropertyGet($oTag, "innertext") = "Translate!" Then
_IEAction($oTag, "click")
EndIf
Next


$Noob = _IEFormElementGetValue($oQuery)

sleep(100)
ControlHide($Test,"","Afx:00400000:2b")
ControlSetText($Test,"","Edit1",$Noob)
Sleep(100)
ControlShow($Test,"","Afx:00400000:2b")

endfunc

That right there, Theres a form that has a little webbrowser embedded into it.

That webrowser goes to a translator website.

Its suppose to grab the current text that inside of notepad, paste it into the first translate box on that webbrowser, press the Translate button, copy the results from the results box, and replace the text.

But its not working D:

i have no idea why... can someone help me fix this?

Edited by Mouse
Link to comment
Share on other sites

To edit the title go to the first post, click on Full Editor and change the title.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Unfortunately I can't test because the site is blocked here.

If you run your script from ScITE do you get any error messages in the output pane of SciTE?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Local $oQuery2 = _IEGetObjById($oIE, "translated")
    $Noob = _IEFormElementGetValue($oQuery2)
    MsgBox(0,'',$Noob)

if you need something else then tell which part of script isn't working, just saying "But its not working D:" will not do.

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Local $oQuery2 = _IEGetObjById($oIE, "translated")
    $Noob = _IEFormElementGetValue($oQuery2)
    MsgBox(0,'',$Noob)

if you need something else then tell which part of script isn't working, just saying "But its not working D:" will not do.

Thank you so much! Genius!
Link to comment
Share on other sites

lol

Posted Image

Let Me Gaze Into My Crystal Ball tutorial is finally working:P

no problem but next time please do try to be more specific about what part isn't working ;)

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

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