Jump to content

Complete Noob Here - Friendly how to's


jnkbcs
 Share

Recommended Posts

Ok, here goes. my company has a GUI that runs a bunch of applications by a press of a button. its pretty neat i know. The problem is the tool is outdated and the person who wrote it is no longer with the company. I have taken the challenge and tried to rewrite it so if i left it wont be hard to pick up and customize, i have a few things done mainly the overall look and feel but i am having trouble writing the scripts. i have been reading the docs and i think i need some pointers.

1. What to use instead of GOTO.

2. Use a text box to input and then store it and then use it with other button.

3. if Button A is pressed how do i use a progress bar while its searching (Trying to make it fancy) ;)

4. return results from #3 into two different list boxes. or just combine and make one. (Prob do that)

Here is the file i am working on:

powerscript.au3

This is what the layout looks like:

post-60108-12844968388541_thumb.jpg

any help or pointers would be greatly appreciated.

Link to comment
Share on other sites

I didn't understand the whole thing but I will try to answer what I did.

- GOTO from batch file can be replaced with if...Then statement

- You can use GUICtrlRead() to read the text from the text boxes.

- See GuiCreateProgress() for the progress bar

- You can use the variable with to hold the return reults and output to as many list boxes you want.

Good Luck!!! and welcome!

Link to comment
Share on other sites

I didn't understand the whole thing but I will try to answer what I did.

- GOTO from batch file can be replaced with if...Then statement

- You can use GUICtrlRead() to read the text from the text boxes.

- See GuiCreateProgress() for the progress bar

- You can use the variable with to hold the return reults and output to as many list boxes you want.

Good Luck!!! and welcome!

Thanks Jat421.

Let me be a little more specific so this way any help that i get will help someone else down the line.

1. The text input will be used for Userid's network. Like FRED234.

2. The Search button will query the network and pull up the computers it has logged into or is logged onto now.

3. The two list boxes will show the results accordingly. I know this is allot i am tackling.

4. When you click on one of the computer names it gets brought up to the computer name text box

5. Now i have some fun. I can either click the Shadow Button ( I know its remoting in but this comp calles it shadowing) by the variable in the computer name text box

6. The next two tabs will use the computer name box as well to do various stuff.

Whew. thats allot on the first tab i know. For now i want to break it up and learn it step by step. Currently there is one While .. Wend clause.

I want to know if i take the line:

$Search = GUICtrlCreateButton("Search", 72, 41, 83, 25)

GUICtrlSetFont(-1, 12, 400, 0, "Berlin Sans FB")

$userid = GUICtrlCreateInput("", 160, 41, 81, 23)

GUICtrlSetFont(-1, 10, 400, 0, "Berlin Sans FB")

Can I create another While statement or do i need to carry on in the same one that has been started? and if so how do i separate so i can jump down to that command? Like i said I am really new at this. And i hope i haven't bitten off more than i can chew.

Edited by jnkbcs
Link to comment
Share on other sites

  • Moderators

jnkbcs,

Welcome to the AutoIt forum. ;)

i hope i haven't bitten off more than i can chew

No, but you might have to take slightly smaller mouthfuls to begin with! :P

First, you need to get a basic grounding in how AutoIt works. Creating a GUI is simple - it is the code behind the pretty buttons that does the work. For example, I have just looked at one of my larger scripts - out of around 4600 lines, only about 200 create the front-end GUI. So you have a lot of work to do to fill in the "working parts" of your script :)

Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page).

Once you have a grasp of how AutoIt functions, you should then see more clearly how you will need to structure your code to do what you require. The best advice I can give is to break it up into small chunks and solve each part at a time. That is when we can help you sort out any problems you might run across.

I know you want to start coding your app NOW, but some study first will save you a lot of trouble later on, believe me. If you just try and cobble together something using examples plucked from the forum without understanding how they interact, you will end up with completely unmaintainable code and neither you nor any eventual successor will thank you for it later. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

jnkbcs,

Welcome to the AutoIt forum. ;)

No, but you might have to take slightly smaller mouthfuls to begin with! :P

First, you need to get a basic grounding in how AutoIt works. Creating a GUI is simple - it is the code behind the pretty buttons that does the work. For example, I have just looked at one of my larger scripts - out of around 4600 lines, only about 200 create the front-end GUI. So you have a lot of work to do to fill in the "working parts" of your script :)

Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page).

Once you have a grasp of how AutoIt functions, you should then see more clearly how you will need to structure your code to do what you require. The best advice I can give is to break it up into small chunks and solve each part at a time. That is when we can help you sort out any problems you might run across.

I know you want to start coding your app NOW, but some study first will save you a lot of trouble later on, believe me. If you just try and cobble together something using examples plucked from the forum without understanding how they interact, you will end up with completely unmaintainable code and neither you nor any eventual successor will thank you for it later. ;)

M23

Melba23 - Thanks for the info.

That's what i needed to hear. I am working the tutorials from the documentation now. so well see how well it goes. last thing i want to do is get snippet from here and there and then i have no idea how they work.

o:)

Link to comment
Share on other sites

I didn't understand the whole thing but I will try to answer what I did.

- GOTO from batch file can be replaced with if...Then statement

- You can use GUICtrlRead() to read the text from the text boxes.

- See GuiCreateProgress() for the progress bar

- You can use the variable with to hold the return reults and output to as many list boxes you want.

Good Luck!!! and welcome!

Hey Jat421 -

Where do i find the info on the GuiCreateProgress()? I looked in help and can not find anything on that

Link to comment
Share on other sites

  • Moderators

jnkbcs,

When you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Melba23 -

Will do. Yeah i found it after doing some searching.

I decidesd to take a step backward and do a little coding to see how its all working. I am trying to run an application but i need to declare two programs. I am trying to get the values for the Systernals suite going.

Here is what i have so far;

$prodam =" "

$pass =" "

$compip =" "

RunAs( $prodam, 'prod-am', $pass, 2, "c:\temp\psexec", $compip "c:\program files\internet explorer\iexplore.exe")

not having any luck. any ideas?

Link to comment
Share on other sites

Can it be strung this way?

; Fill in the username and password appropriate for your system.

Local $sUsername = "Username"

Local $sPassword = "Password"

Local $sCompname = "Computername"

Local $sDomain = "Domainname"

; Run psexec.exe from a remote machine to close out a process.

Local $pid = RunWait("c:\temp\psexec -s" $sCompname "-c pskillie.cmd", "c:\")

; Wait for the process to close.

ProcessWaitClose($pid)

This is from the help on sysinternals site:

To run Internet Explorer as with limited-user privileges use this command:

psexec -l -d "c:\program files\internet explorer\iexplore.exe"

but i want to pass values to it and be run from remote machine.

can i cut up a command like i have above?

Edited by jnkbcs
Link to comment
Share on other sites

Ok i have it figured out:

Local $sCompname = ""

Local $sDomain = ""

Local $sPsexe = "C:\temp\psexec -s \\"

Local $sIEkill = " c:\temp\pskill iexplore"

; Run a command prompt as the other user.

Local $iekill = RunWait($sPsexe & $sCompname & $sIEkill)

; Wait for the process to close.

ProcessWaitClose($iekill)

now all i need to do is add it to my main program. <cracking of nuckles>

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