Jump to content

make autoit understand the written text !!!


Recommended Posts

Hello:

how to make autoit understand the written text? means: in this script how can i make it tell me the text which is befor (@) and .... which is after the dot (.) ????

is it possible in autoit? if not... how to do that in another way??!

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 224, 237, -1, -1)
$Input1 = GUICtrlCreateInput("[email="me@hotmail.com"]me@hotmail.com[/email]", 24, 24, 177, 21)
$Input2 = GUICtrlCreateInput("my folder is .temp", 24, 101, 177, 21)
$Button1 = GUICtrlCreateButton("show only name that before aat (@)", 24, 56, 177, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("show name that is after the dot (.)", 23, 137, 177, 25, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("The first button must show (me)", 24, 192, 147, 17)
$Label2 = GUICtrlCreateLabel("The second button must show (temp)", 24, 209, 175, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  case $Button1
   msgbox(0,"my name","")
  case $Button2
   msgbox(0,"my folder","")
 EndSwitch
WEnd
Link to comment
Share on other sites

Hard to understand what your talking bout willis? like this?

Edit Better Yet<> :blink:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 224, 237, -1, -1)
$Input1 = GUICtrlCreateInput('[email="me@hotmail.com"]me@hotmail.com[/email]',  24, 24, 177, 21)
$Input2 = GUICtrlCreateInput("my folder is .temp", 24, 101, 177, 21)
$Button1 = GUICtrlCreateButton("show only name that before aat (@)", 24, 56, 177, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("show name that is after the dot (.)", 23, 137, 177, 25, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("The first button must show (me)", 24, 192, 147, 17)
$Label2 = GUICtrlCreateLabel("The second button must show (temp)", 24, 209, 175, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  case $Button1
    $EndJa = StringInStr(GUICtrlRead($Input1),']')
    $AtSym = StringInStr(GUICtrlRead($Input1),'@',0,2)
    $User = StringLeft(GUICtrlRead($Input1),$AtSym - 1)
    $User = StringTrimLeft($User,$EndJa)
   msgbox(0,"my name",$User)
  case $Button2
    $StrFind = StringInStr(GUICtrlRead($Input2),'.')
    $LastExt = StringLen(GUICtrlRead($Input2)) - $StrFind
    $Ext = StringRight(GUICtrlRead($Input2),$LastExt)
   msgbox(0,"my folder",$Ext)
 EndSwitch
WEnd
Edited by lordicast
[Cheeky]Comment[/Cheeky]
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...