Jump to content

Hi , New Here And Just Need A Little Start


Recommended Posts

I just downloaded this the other day and , well trying to leasrn how to use it .

I have a short term memory loss so if I ask a few times you know why . It's not cus I'm lasy . lol

But anyways I found that gui thing that makes a gui with the buttons and all that but I'm not sure where to add the code to it to make it work right ?

So I'm hoping that if I could get one kind of how it is done I can learn and fall back on it when I forget .

I made one with a few buttons on it and a input box and a edit box so could someone add the code to make it open anything I don't care as I can then fool with it till I learn how it works .same with the edit and input box's .

;Generated with AutoBuilder 0.3

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 392,477,10,10,0x04CF0000)
$button_1 = GUISetControl("button", "Button 1", 10,30, 70,20)
$button_2 = GUISetControl("button", "Button 2", 10,60, 70,20)
$input_1 = GUISetControl("input", "Input 1", 160,50, 170,20)
$button_3 = GUISetControl("button", "Button 3", 340,50, 50,20)
$edit_1 = GUISetControl("edit", "Edit 1", 160,100, 170,220)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
  Exit
    Case $msg = $button_1
    ;;;
    Case $msg = $button_2
    ;;;
    Case $msg = $input_1
    ;;;
    Case $msg = $button_3
    ;;;
    Case $msg = $edit_1
    ;;;
    EndSelect
WEnd
Exit

Thank you for any help and if you could add some comment so I know what you did to it so I can learn .

Bob .

Link to comment
Share on other sites

Look under case, put in a function or something to do.

;Generated with AutoBuilder 0.3

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 392,477,10,10,0x04CF0000)
$button_1 = GUISetControl("button", "Button 1", 10,30, 70,20)
$button_2 = GUISetControl("button", "Button 2", 10,60, 70,20)
$input_1 = GUISetControl("input", "Input 1", 160,50, 170,20)
$button_3 = GUISetControl("button", "Button 3", 340,50, 50,20)
$edit_1 = GUISetControl("edit", "Edit 1", 160,100, 170,220)

GuiShow()

While 1
sleep(100)
$msg = GuiMsg(0)
Select
Case $msg = -3
 Exit
Case $msg = $button_1
Run("notepad.exe")
Case $msg = $button_2
;;;
Case $msg = $input_1
;;;
Case $msg = $button_3
;;;
Case $msg = $edit_1
;;;
EndSelect
WEnd
Exit

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Thank you scriptkitty , I just found out how to do that one on my own (quite proud now ) but I don't under stand what to do with the

Case $msg = $input_1

;;;

Case $msg = $input_2

So how would I type something in the input_1 and have it go to the input_2box what would be the edit box in the window .

EDIT :

What I want to do is what I have been doing with MMB software .

You can do a search of files and then have it list what kind of file you want to see wthere the file is at in your computer with code like this

** Show BrowseForFolder dialog
BrowseForFolder("Select folder with images:","")
** Assign selected directory to a variable
DirPath$=CBK_OpenDir
If (DirPath$ <> '') Then
  ** Search gmd files in selected directory
  SearchForFiles("DirPath$","gmd")
  OpenFile$='<SrcDir>\listfile.txt'
  SongListSave("","OpenFile$")
  ** Turn OFF displaying Time column and IDTags loading (speed up the loading process)
  ListBoxParam("ListBox","TIMES=OFF")
  ListBoxParam("ListBox","IDTAGS=OFF")
  ** Reset ListBox contents
  ListBoxAddItem("ListBox","RESET")
  ** Fill ListBox with found files
  ListBoxAddItem("ListBox","OpenFile$")
  ** Finally, select the first item in ListBox
  ListBoxSelectItem("ListBox","1")
  ** reset SaveAs path variable
End

So the one button (don't matter right now ) would search and then list it in the box text box .

here is a screen shot .

Posted Image

Edited by bobheart
Link to comment
Share on other sites

Here is a quick example of button stuff.

Button 1 will now display some stuff.

Button 2 will open the select files popup and paste them into Edit2 for ya.

...edit typed "into Edit1 for ya." instead of into "Edit2 for ya." :D

;Generated with AutoBuilder 0.3

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 392,477,10,10,0x04CF0000)
$button_1 = GUISetControl("button", "Button 1", 10,30, 70,20)
$button_2 = GUISetControl("button", "Button 2", 10,60, 70,20)
$input_1 = GUISetControl("input", "Input 1", 160,50, 170,20)
$button_3 = GUISetControl("button", "Button 3", 340,50, 50,20)
$edit_1 = GUISetControl("edit", "Edit 1", 160,100, 170,220)

GuiShow()

While 1
sleep(100)
$msg = GuiMsg(0)
Select
Case $msg = -3
Exit
Case $msg = $button_1
MsgBox(1,"Edit 1 info",GUIRead ($edit_1))
MsgBox(1,"Input info",GUIRead ($input_1))
Case $msg = $button_2
dosomething()
Case $msg = $input_1
;;
Case $msg = $button_3
;;;
Case $msg = $edit_1
;;;
EndSelect
WEnd
Exit

Func dosomething()
    $_var = FileOpenDialog("What files?", "C:\Windows\", "Images (*.jpg;*.bmp)", 1 + 4 )
$Avar=StringSplit($_var,"|")
$_out=""
For $i=2 To $Avar[0]
    $_out=$_out & $Avar[1] & "\" & $Avar[$i] & @CRLF
Next
ControlSetText ("MyGUI","","Edit2",$_out) 
EndFunc

Keeping your original code as close as possible so you can understand it a bit easier.

Hope my dosomething() doesnt' mix you up too much, basically it is just parsing the filenames and starting directory into easy to read text, and updating GUI.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

I see it puts the info in a message box but how do you make it go into the edit box ?

So if you put text in input box 1 , how do you make it go in to input box 2 (the bigger box )

Is there a note pad Example ?

Edited by bobheart
Link to comment
Share on other sites

try replacing this part

Case $msg = $button_3
    RunWait(@ComSpec & " /c dir /b c:\ >c:\tempfile11.txt","",@SW_HIDE)
    $_out=fileread("c:\tempfile11.txt",FileGetSize("c:\tempfile11.txt"))
ControlSetText ("MyGUI","","Edit2",$_out)
Case $msg = $edit_1

or for notepad example, try this.

Case $msg = $button_3
    RunWait(@ComSpec & " /c dir /b c:\ >c:\tempfile11.txt","",@SW_HIDE)
    $_out=fileread("c:\tempfile11.txt",FileGetSize("c:\tempfile11.txt"))
ControlSetText ("MyGUI","","Edit2",$_out)
run('notepad.exe "c:\tempfile11.txt")
Case $msg = $edit_1

...edit, I put it into the bigger box on my computer. checking something... yea I put it in Edit2, but told ya I put it into edit1. :D

I didnt' feel like typing the whole thing out.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

---------------------------
AutoIt Error
---------------------------
Line 32  (File "E:\Programs\AutoIt3\Examples\English\dosomething.au3"):

run('notepad.exe "c:\tempfile11.txt")
run(^ ERROR

Error: String missing closing quote.

The other one then gives the drive info for the C: drive ,, thats cool .

Link to comment
Share on other sites

so, close the quote:

run('notepad.exe "c:\tempfile11.txt" ')

Thank you that fix that ..

this line here

RunWait(@ComSpec & " /c dir /b c:\ >c:\tempfile11.txt","",@SW_HIDE)

Can it look for a certain file ? like say all txt files . of I have a file that is gmd can it show all files like that ?

Link to comment
Share on other sites

  • Developers

Thank you that fix that ..

this line here

RunWait(@ComSpec & " /c dir /b c:\ >c:\tempfile11.txt","",@SW_HIDE)

Can it look for a certain file ?  like say all txt files . of I have a file that is gmd can it show all files like that ?

you mean?

RunWait(@ComSpec & " /c dir *.gmd  /b c:\ >c:\tempfile11.txt","",@SW_HIDE)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

RunWait(@ComSpec & " /c dir *.gmd /b c:\ >c:\tempfile11.txt","",@SW_HIDE) that still breings up the folders not a gmd file list .

I know there are gmd' files there..

Link to comment
Share on other sites

  • Developers

RunWait(@ComSpec & " /c dir *.gmd  /b c:\ >c:\tempfile11.txt","",@SW_HIDE)  that still breings up the folders not a gmd file list .

I know there are gmd' files there..

Are you sure about the CURRENT Directory for the DIR command ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Are you sure about the CURRENT Directory for the DIR command ?

I'm sorry your right it did save them I was looking in the wrong folder for the txt file with the info . but I would like it to list just gmd files not all the files can this be done ?

What i found wwas a results.txt and results.log and I can't see where that is in the au3 file ? they where both in the foler I'mrunning the au3 from.

Edited by bobheart
Link to comment
Share on other sites

  • Developers

I'm sorry your right it did save them I was looking in the wrong folder for the txt file with the info . but I would like it to list just gmd files not all the files can this be done ?

What i found wwas a results.txt and results.log and I can't see  where  that is in the au3 file ? they where both in the foler I'mrunning the au3 from.

:D Isn't that just what "dir *.gmd" does ??

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

No it had all the folders and files in the C: drive . I would like just gmd files to show .or search for .

But I must thank you guys as this is helping me learn ..

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