+ Post New Thread
Results 1 to 14 of 14
Scripts Thread, AutoIT V3 - Window Info Tool... in Coding and Web Development; Morning, I have recently discovered AutoIT following a need to create a script which acts as a panic button type ...
  1. #1
    acrobson's Avatar
    Join Date
    May 2007
    Location
    Tyne & Wear
    Posts
    519
    Thank Post
    5
    Thanked 6 Times in 6 Posts
    Rep Power
    17

    AutoIT V3 - Window Info Tool...

    Morning,

    I have recently discovered AutoIT following a need to create a script which acts as a panic button type of thing. However, how does the 'Window Info' tool work exactly? There are one or two aspects which will require the mouse pointer to select a certain button on the screen in a certain location. This is not to send bulk emails or text for marketing etc.

    Any help would be very welcome!


    The idea being,

    The compiled script executable is clicked
    IE then opens
    The URL for a webmail provider (Gmail, Hotmail etc) is entered
    The credentials are then entered to log in
    Compose new email is selected
    Pre-defined - Message recipitents are entered
    Pre-defined -Message subject entered
    Pre-defined - Message body entered
    and then click send

    Following this,

    Another IE window is opened
    The URL is entered for a free txt messaging website (Such as 02)
    Credentials are entered
    Send new text selected
    Pre-defined - Message recipitents are entered
    Pre-defined -Message subject entered
    Pre-defined - Message body entered
    and then click send
    Alarm raised

  2. #2
    TheLibrarian
    Guest
    That's a lot of fuss to send a panic e-mail, doesn't your school have an e-mail server?

    If so you would probably be better sending the e-mail through that, of course if you don't...

    As for the Window Info tool, I'm not entirely sure that will help much when you are pointing it at IE. IIRC the tool is used when you need information about a window to help you code the script in regards to which window to activate / work on.

  3. #3
    TheLibrarian
    Guest
    We have a system specifically designed for reporting bullying etc. issues. Funding was provided by West Midlands Police although I think it was only a couple of hundred pounds for the year.

    It's called the Sharp system The SHARP System | School Help Advice Reporting Page.

    We have had some genuine reports through this and as such it's worth every penny.

  4. #4
    acrobson's Avatar
    Join Date
    May 2007
    Location
    Tyne & Wear
    Posts
    519
    Thank Post
    5
    Thanked 6 Times in 6 Posts
    Rep Power
    17
    Quote Originally Posted by TheLibrarian View Post
    We have a system specifically designed for reporting bullying etc. issues. Funding was provided by West Midlands Police although I think it was only a couple of hundred pounds for the year.

    It's called the Sharp system The SHARP System | School Help Advice Reporting Page.

    We have had some genuine reports through this and as such it's worth every penny.
    Thanks for the reply, to be honest, this isn't for work use, I had a family situation a while back and wanted to implement something to reduce the time it takes for someone to respond, otherwise, the email server would be spot on or going down the line of procuring some third party solution such as the Sharp System as you suggested.

    I'm simply wanting something which sends an email/text alert at the click of a button. The idea being this can complement any other system, such as a phone to dial the 999 service and not replace anything.

  5. #5
    TheLibrarian
    Guest
    In which case I'd suggest trying AutoIT on Outlook Express, you will likely find that much easier.

  6. #6


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,709
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    Quote Originally Posted by acrobson View Post
    The compiled script executable is clicked
    IE then opens
    The URL for a webmail provider (Gmail, Hotmail etc) is entered
    The credentials are then entered to log in
    Compose new email is selected
    Pre-defined - Message recipients are entered
    Pre-defined -Message subject entered
    Pre-defined - Message body entered
    and then click send
    Personally I would avoid doing this, especially when better alternatives exist - there are far too many things that could go wrong with a script which clicks buttons. What if the webpage times out, the way you login to the webmail system changes or an update to your web browser (or an add-on) causes a dialog box to popup which you are not expecting?

    A better alternative would be to use a command-line mailer or a script which sends the e-mail programmatically via an SMTP server which you can authenticate against. The VBScript below is just one method you could use. This is a working example for GMail.

    SendE-mailViaGmail.vbs
    Code:
    Const schema   = "http://schemas.microsoft.com/cdo/configuration/"
    Const cdoBasic = 1
    Const cdoSendUsingPort = 2
    Dim oMsg, oConf
    
    ' E-mail Properties
    Set oMsg      = CreateObject("CDO.Message")
    oMsg.From     = "from@gmail.com"         ' or "Sender Name <from@gmail.com>"
    oMsg.To       = "to@gmail.com"           ' or "Recipient Name <to@gmail.com>"
    oMsg.Subject  = "Subject goes here"
    oMsg.TextBody = "Body text"
    
    ' GMail SMTP server configuration and authentication info
    Set oConf = oMsg.Configuration
    oConf.Fields(schema & "smtpserver")       = "smtp.gmail.com"
    oConf.Fields(schema & "smtpserverport")   = 465
    oConf.Fields(schema & "sendusing")        = cdoSendUsingPort
    oConf.Fields(schema & "smtpauthenticate") = cdoBasic
    oConf.Fields(schema & "smtpusessl")       = True
    oConf.Fields(schema & "sendusername")     = "from@gmail.com"
    oConf.Fields(schema & "sendpassword")     = "senders_password"
    oConf.Fields.Update
    
    oMsg.Send

  7. 2 Thanks to Arthur:

    acrobson (1st November 2010), russdev (1st November 2010)

  8. #7
    acrobson's Avatar
    Join Date
    May 2007
    Location
    Tyne & Wear
    Posts
    519
    Thank Post
    5
    Thanked 6 Times in 6 Posts
    Rep Power
    17
    Quote Originally Posted by Arthur View Post
    Personally I would avoid doing this, especially when better alternatives exist - there are far too many things that could go wrong with a script which clicks buttons. What if the webpage times out, the way you login to the webmail system changes or an update to your web browser (or an add-on) causes a dialog box to popup which you are not expecting?

    A better alternative would be to use a command-line mailer or a script which sends the e-mail programmatically via an SMTP server which you can authenticate against. The VBScript below is just one method you could use. This is a working example for GMail.

    SendE-mailViaGmail.vbs
    Code:
    Const schema   = "http://schemas.microsoft.com/cdo/configuration/"
    Const cdoBasic = 1
    Const cdoSendUsingPort = 2
    Dim oMsg, oConf
    
    ' E-mail Properties
    Set oMsg      = CreateObject("CDO.Message")
    oMsg.From     = "from@gmail.com"         ' or "Sender Name <from@gmail.com>"
    oMsg.To       = "to@gmail.com"           ' or "Recipient Name <to@gmail.com>"
    oMsg.Subject  = "Subject goes here"
    oMsg.TextBody = "Body text"
    
    ' GMail SMTP server configuration and authentication info
    Set oConf = oMsg.Configuration
    oConf.Fields(schema & "smtpserver")       = "smtp.gmail.com"
    oConf.Fields(schema & "smtpserverport")   = 465
    oConf.Fields(schema & "sendusing")        = cdoSendUsingPort
    oConf.Fields(schema & "smtpauthenticate") = cdoBasic
    oConf.Fields(schema & "smtpusessl")       = True
    oConf.Fields(schema & "sendusername")     = "from@gmail.com"
    oConf.Fields(schema & "sendpassword")     = "senders_password"
    oConf.Fields.Update
    
    oMsg.Send
    Thank you, much appreciated. I totally understand where your coming from with regards to unknown entities around updates and page changes etc. That was a major concern of mine also, however, at the same time, I just wanted 'a solution' to solve a problem close to hand.

    I've just given that a try and it worked a teat. Very impressed!

    You don't happen to know of a solution to send SMS text messages online do you? :-)

  9. #8

    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,160
    Thank Post
    98
    Thanked 318 Times in 260 Posts
    Blog Entries
    4
    Rep Power
    111
    Quote Originally Posted by acrobson View Post
    You don't happen to know of a solution to send SMS text messages online do you? :-)
    Free Email to SMS Gateways - these might be worth a look.

  10. #9

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,236
    Thank Post
    1,057
    Thanked 1,067 Times in 624 Posts
    Rep Power
    740
    I used to use this before I installed Spiceworks.

    Panic Button | Download Panic Button software for free at SourceForge.net

    I have done a script which takes a screen shot for users for Spiceworks too:

    Spice Works Screen Capture Script

  11. #10


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,709
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    Quote Originally Posted by acrobson View Post
    You don't happen to know of a solution to send SMS text messages online do you? :-)
    JamesB's suggestion of an e-mail to SMS gateway is a good one. I am not sure how accurate it is but there is a list of e-mail addresses you can use for this purpose for each of the main mobile networks in the UK here.

    I currently use FastMail's e-mail to SMS service whenever I am unable to use my mobile phone, mainly because I have had an account with them for years, it is dead easy to use and more importantly, cheap. It costs $4.95 (3.09) per year for a basic "Ad Free" account which enables you to use thier SMTP servers for sending e-mails, plus $0.12 (7p) per text message. To send a text message, you would create an e-mail in the usual way (or via a script), write your message in either the subject or body and then send it to a special e-mail address: 447123456789@sms.messagingengine.com (the bit before the @ symbol being the recipients mobile phone number in international format) and that's all there is to it. The text message will be received by the other person seconds later.

    Quote Originally Posted by acrobson View Post
    Another IE window is opened
    The URL is entered for a free txt messaging website (Such as 02)
    Credentials are entered
    Send new text selected
    Pre-defined - Message recipitents are entered
    Pre-defined -Message subject entered
    Pre-defined - Message body entered
    and then click send
    Alarm raised
    Rather than use the MouseMove, MouseClick & Send (or ControlClick & ControlSend) functions in AutoIt, you should find the various UDFs for Internet Explorer to be more reliable (details on these can be found in AutoIt's help file).

    Here's a script I created earlier which uses some of these functions to log into the Orange website and send a text message. To find the correct form values and names, I used the Web Developer extension (for Chrome or Firefox) and selected the "Display Form Details" option under Forms. I found this was a lot easier compared to searching through the source code of the webpage in question. Whoever did Orange's website has obviously never learnt about using CSS for layout.

    Code:
    #NoTrayIcon
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Res_Description=Send a text message via Orange's website
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
    #AutoIt3Wrapper_Res_SaveSource=y
    #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
    #AutoIt3Wrapper_Run_After=upx.exe --best --compress-resources=0 "%out%"
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    
    #include <IE.au3>
    $oIE = _IECreate ("http://www.orange.co.uk/redirect/redirect=ext&linkfrom=hp4&link=dashboard_pos_3_link_1&article=todaypage09dashboardsendafreetext&destdomain=orange&linkto=https://services.orange.co.uk/sms/send", 0, 1, 1, 1) ; You could also use a short URL: http://goo.gl/EKuB
    
    ; LOGIN OR REGISTER
    $oForm = _IEFormGetObjByName($oIE, "registrationForm")
    $oLogin = _IEFormElementGetObjByName($oForm, "txtMSISDN")
    _IEFormElementSetValue($oLogin, "07973123999") ; Your Orange mobile number
    $oLogin = _IEFormElementGetObjByName($oForm, "txtPassword")
    _IEFormElementSetValue($oLogin, "Pa$$W0rd") ; Your password
    
    ; Click "Continue" button. If the button wasn't an image, you would use: _IEFormSubmit($oForm)
    _IEFormImageClick ($oIE, "continue", "name", "", 1)
    
    ; SEND A TEXT MESSAGE
    $oTextForm = _IEFormGetObjByName($oIE, "smsform")
    _IEFormElementRadioSelect($oTextForm, "1", "sms_from_rad") ; 0 = Send from website / 1 = Send as if from your phone
    
    $oNumber = _IEFormElementGetObjByName($oTextForm, "sendSmsMessageToNumber")
    _IEFormElementSetValue($oNumber, "07973100150") ; Recipients number
    $oMessage = _IEFormElementGetObjByName($oTextForm, "sendSmsMessage")
    _IEFormElementSetValue($oMessage, "Hello!")     ; Message
    
    ; Click "Send" button
    _IEFormImageClick ($oIE, "Send the message", "name", "", 1)
    
    ; Click "Send" button again to confirm
    _IEFormImageClick ($oIE, "request2", "name", "", 1)

  12. Thanks to Arthur from:

    acrobson (1st November 2010)

  13. #11
    browolf's Avatar
    Join Date
    Jun 2005
    Location
    Mars
    Posts
    1,524
    Thank Post
    106
    Thanked 88 Times in 74 Posts
    Blog Entries
    46
    Rep Power
    40
    there's some software already called panic button: Panic Button | Download Panic Button software for free at SourceForge.net

    Panic Button provides an icon in the Windows system tray. By clicking on this icon, a user may send a screen grab and a report form to a help desk or similar. This should make it easier for users to provide useful error/problem reports to support staffs.

  14. #12


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,709
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    Panic Button doesn't send text messages though.

  15. #13
    acrobson's Avatar
    Join Date
    May 2007
    Location
    Tyne & Wear
    Posts
    519
    Thank Post
    5
    Thanked 6 Times in 6 Posts
    Rep Power
    17
    Thank you Arthur, I'll check out the AutoIT code. I am currently using the VB script as mentioned earlier to cover the user for the time being. I would just like to build upon this to keep as many angles covered as possible. Everyone's input has been much appreciated.

    The SMS gateway's are a great idea, I have looked into these, however, one of the main mobile networks which I need it to work with is Vodafone, however Vodafone kindly closed their SMS gateway when they got rid of Vodafone.net mail in late 2009. However. FastMail certainly sounds like a more viable option.

    Cheers, AC

  16. #14

    russdev's Avatar
    Join Date
    Jun 2005
    Location
    Leicestershire
    Posts
    6,915
    Thank Post
    708
    Thanked 549 Times in 364 Posts
    Blog Entries
    3
    Rep Power
    204
    Quote Originally Posted by Arthur View Post
    Personally I would avoid doing this, especially when better alternatives exist - there are far too many things that could go wrong with a script which clicks buttons. What if the webpage times out, the way you login to the webmail system changes or an update to your web browser (or an add-on) causes a dialog box to popup which you are not expecting?

    A better alternative would be to use a command-line mailer or a script which sends the e-mail programmatically via an SMTP server which you can authenticate against. The VBScript below is just one method you could use. This is a working example for GMail.

    SendE-mailViaGmail.vbs
    Code:
    Const schema   = "http://schemas.microsoft.com/cdo/configuration/"
    Const cdoBasic = 1
    Const cdoSendUsingPort = 2
    Dim oMsg, oConf
    
    ' E-mail Properties
    Set oMsg      = CreateObject("CDO.Message")
    oMsg.From     = "from@gmail.com"         ' or "Sender Name <from@gmail.com>"
    oMsg.To       = "to@gmail.com"           ' or "Recipient Name <to@gmail.com>"
    oMsg.Subject  = "Subject goes here"
    oMsg.TextBody = "Body text"
    
    ' GMail SMTP server configuration and authentication info
    Set oConf = oMsg.Configuration
    oConf.Fields(schema & "smtpserver")       = "smtp.gmail.com"
    oConf.Fields(schema & "smtpserverport")   = 465
    oConf.Fields(schema & "sendusing")        = cdoSendUsingPort
    oConf.Fields(schema & "smtpauthenticate") = cdoBasic
    oConf.Fields(schema & "smtpusessl")       = True
    oConf.Fields(schema & "sendusername")     = "from@gmail.com"
    oConf.Fields(schema & "sendpassword")     = "senders_password"
    oConf.Fields.Update
    
    oMsg.Send
    That is great just what I am looking for. Been wanting to have a report this computer icon for a while.

    Russ

SHARE:
+ Post New Thread

Similar Threads

  1. autoit - any experts?
    By RabbieBurns in forum Scripts
    Replies: 4
    Last Post: 8th April 2010, 09:23 PM
  2. autoit help please
    By RabbieBurns in forum Scripts
    Replies: 8
    Last Post: 16th June 2008, 03:47 PM
  3. AutoIT help.
    By K.C.Leblanc in forum Scripts
    Replies: 7
    Last Post: 28th November 2007, 03:27 PM
  4. AutoIT help
    By randle in forum Windows
    Replies: 14
    Last Post: 11th July 2007, 09:26 AM
  5. AutoIT
    By Gatt in forum Scripts
    Replies: 3
    Last Post: 3rd July 2007, 01:29 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •