Sign in to follow this  
Followers 0
bobheart

Hi , New Here And Just Need A Little Start

28 posts in this topic

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 .

Share this post


Link to post
Share on other sites



Anyone ?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Thank you Lar .. I'm learning this but it takes me time and seeing it makes it a little easyer (<-word?) .

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

The dosomething() , it opens the browers window so how do you get that info (say a txt file ) in to the big input box ?

Share this post


Link to post
Share on other sites

actually it should be how did you?

ControlSetText ("MyGUI","","Edit2",$_out)

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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.

Share this post


Link to post
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 .

Share this post


Link to post
Share on other sites

so, close the quote:

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


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
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 ?

Share this post


Link to post
Share on other sites

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)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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..

Share this post


Link to post
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..

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Will i dropped one gmd file and it did find that . biut I would like it to list just the gmd filles but not sure if that is do able ?

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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 ..

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