Sign in to follow this  
Followers 0
Thatsgreat2345

Ie Setting Value In Text Area

3 posts in this topic

OK ive been workin on this and i cant seem to figure it out im making a texter for my friends and im using googles texting thingy and so ive been trying to set the message but its not setting, everything else works just not the stupid message

this is the website http://toolbar.google.com/send/sms/index.php

and this the stupid text area thing <textarea name=text id=body rows=8 cols=45></textarea>

and it just isnt working

#include <IE.au3>
#include <GUIConstants.au3>
#include <file.au3>
$GUI = GUICreate("Texter", 454, 224, 192, 125)
$number = GUICtrlCreateInput("", 160, 32, 169, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Number (Ex. 503-971-4444)", 16, 32, 134, 17)
GUICtrlCreateLabel("Carrier", 16, 56, 34, 17)
$carrier = GUICtrlCreateCombo("", 160, 56, 169, 21)
guictrlsetdata(-1,"ATT|ALLTEL|CELLULARONE|CINCINNATI_BELL|CINGULAR|CRICKET|METROPCS|MIDWEST_WIRELESS|NEXTEL|OMNIPOI

NT|QWEST|SPRINT|SUNCOM|TMOBILE|USCELLULAR|VERIZON|VIRGIN|WESTERN_WIRELESS")
GUICtrlCreateLabel("Saved Numbers", 16, 8, 80, 17)
$savednumbers = GUICtrlCreateCombo("", 160, 8, 169, 21)
$usesaved = GUICtrlCreateRadio("Use Saved Number", 336, 8, 113, 17)
$usenumber = GUICtrlCreateRadio("Use Number", 336, 32, 113, 17)
GUICtrlCreateLabel("Subject (Optional)", 104, 96, 88, 17)
$subject = GUICtrlCreateInput("", 200, 96, 81, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Message", 176, 128, 47, 17)
$Message = GUICtrlCreateInput("", 16, 152, 385, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Number of Characters", 272, 192, 107, 17)
GUICtrlCreateLabel("0", 384, 192, 10, 17)
$send = GUICtrlCreateButton("Send Text", 80, 184, 105, 25)
$savenumber = GUICtrlCreateButton("Save Number", 336, 56, 73, 25)
GUISetState(@SW_SHOW)
if FileExists(@scriptdir & "\savednumbers.ini") Then
    Guictrlsetdata($savednumbers,INIread(@ScriptDir & "\savednumbers.ini","Numbers","Number",""))
    Guictrlsetdata($carrier,IniRead(@ScriptDir & "\savednumbers.ini","Numbers","Carrier",""))
EndIf

Do 
    $msg = GUIGetMsg()
    Select
        Case $msg = $savenumber
            _FileCreate(@scriptdir & "/savednumbers.ini")
            $file = @ScriptDir & "/savednumbers.ini"
        $number1 = Guictrlread($number)
        $carrier1 = Guictrlread($carrier)
        if $number1 = "" Then
            msgbox(0,"No number","No number specified please fill one in")
        elseIf $carrier1 = "" Then
            msgbox(0,"No Carrier","Please select a carrier")
        Else
            FileWriteLine($file,"[Numbers]")
            FileWriteLine($file,"Number=" & $number1)
            FileWriteLine($file,"Carrier=" & $carrier1)
            msgbox(0,"Number Saved","The number and carrier have been saved")
        EndIf
    Case $msg = $send
        IF Guictrlread($usesaved) = $GUI_CHECKED Then
        $IE = _IECreate()
            _IEnavigate($IE,"http://www.google.com/sendtophone")
            _IEloadwait($IE)
            $oForm = _IEFormGetObjByName($IE,"sending_form")
            $object = _IEFormElementGetObjByName($oform,"mobile_user_id")
            _IEFormElementSetValue($object,Guictrlread($savednumbers))
            $objectcarrier = _IEFormElementGetObjByName($oform,"carrier")
            _IEFormElementSetValue($objectcarrier,Guictrlread($carrier))    
            $objectsubject = _IEFormElementGetobjByName($oform,"subject")
            _IEFormElementSetValue($objectsubject,GUICtrlRead($subject))
            $objectmessage = _IEFormElementGetObjByName($oForm,"text")
            _IEFormElementSetValue($objectmessage,Guictrlread($Message))
            
        ElseIf Guictrlread($usenumber) Then
            $IE = _IECreate(1)
            _IEnavigate($IE,"http://toolbar.google.com/send/sms/index.php")
            _IEloadwait($IE)
            $oForm = _IEFormGetObjByName($IE,"sending_form")
            $object = _IEFormElementGetObjByName($oform,"mobile_user_id")
            _IEFormElementSetValue($object,Guictrlread($number))
            $objectcarrier = _IEFormElementGetObjByName($oform,"carrier")
            _IEFormElementSetValue($objectcarrier,Guictrlread($carrier))
            $objectsubject = _IEFormElementGetObjByName($oForm,"subject")
            _IEFormElementSetValue($objectsubject,GUICtrlRead($subject))
            $objectmessage = _IEFormElementGetObjByName($oForm,"text")
            _IEFormElementSetValue($objectmessage,Guictrlread($Message))
        EndIf
EndSelect
until $msg = $gui_EVENT_CLOSE

Share this post


Link to post
Share on other sites



I've only looked at it quickly, but try accessing the textarea by index instead of name. It is very possible that "body" is treated as a reserved word.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

thx dale it worked :think:

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