Sign in to follow this  
Followers 0
Hacker4All

A New kind of Message Box?

10 posts in this topic

Okay, so I've got an idea for a new script of mine(when i say new, i mean first) and it starts out with a message box, but i cant seem to find what kind of box it is. I want it to be a box that you can type stuff into, like Run - Solitare, or the stuff like that. What kind of MsgBox, if it is a MsgBox is that?

Share this post


Link to post
Share on other sites



search the help file for inputbox


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

Okay, so, here is what i am trying to do. Odds are, someone else has already done it, but hey, I would like to give it a shot. The InputBox Thingy works like a charm, thank you for that. I am wondering if there was someway to where if you put in, say, "Run Notepad", then the program would then close the MsgBox and then run a notepad. Or if you say, "Run Solitare", then the program would start up the solitare.exe. Is there any way to add a variable for what could possibly be typed in?

Share this post


Link to post
Share on other sites

I have the very basic layout of pretty much what i want it to do:

$ans = InputBox("Linkin'", "What would you like to do today?")

If $ans = "Run Notepad" Then

Run("notepad.exe")

Exit

EndIf

If $ans = "Run Cmd" Then

Run("cmd.exe")

Exit

EndIf

However, I am having trouble fittign a variable into what you would put after "Run". Any Ideas?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

So basically you want to make your own run with AutoIt?

And If notepad.exe was typed into the inputbox you'd go

If $ans = "notepad.exe" Then
ShellExecute("notepad.exe")
Exit
EndIf
Edited by Death

Share this post


Link to post
Share on other sites

Yes, pretty much. I would like to make my own Run, as you put it. But i want it to do something like this, but i dont quite understand how i should put it:

$ans = InputBox("Linkin'", "What would you like to do today?")

If $ans = "Run $process" Then

Run("$process.exe")

I know it doesnt work like that, but that is what i would like for it to do, if you can have a variable within a variable.

Share this post


Link to post
Share on other sites

Yes, pretty much. I would like to make my own Run, as you put it. But i want it to do something like this, but i dont quite understand how i should put it:

$ans = InputBox("Linkin'", "What would you like to do today?")

If $ans = "Run $process" Then

Run("$process.exe")

I know it doesnt work like that, but that is what i would like for it to do, if you can have a variable within a variable.

If $ans = "Run " & $process Then <-- this is how you would concatenate text and variable, that is probably what you need to do what you want


[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites

Two questions: Whats the difference between run and ShellExecute, and what do i declare the $process as?

Share this post


Link to post
Share on other sites

If $ans = "Run " & $process Then <-- this is how you would concatenate text and variable, that is probably what you need to do what you want

That won't work, but it is how you concatenate. Why don't you trim the run from answer and then do a shellexecute ($ans & ".exe").

Whats the difference between run and ShellExecute

Sounds like a question for the help file.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

If $ans = "Run " & $process Then

That won't work, but it is how you concatenate. Why don't you trim the run from answer and then do a shellexecute ($ans & ".exe").

If $ans = "Run " & $process Then

would work fine. But how about:-

$ans = InputBox("Linkin'", "What would you like to do today?")
$split=StringSplit($ans," ")
if $split[1]="run" Then 
Run($split[2] & ".exe")
EndIf

that way you can get the effect i think your after

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

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