Jump to content

A New kind of Message Box?


Recommended Posts

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?

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

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

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

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

Link to comment
Share on other sites

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

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