Make an Assistant for Your Computer in 5 Minutes

70,216

43

38

Posted

Introduction: Make an Assistant for Your Computer in 5 Minutes

Heard of the new iPhone 4S with Siri? In under an hour I made one for windows in VBS. Now I can open youtube just by saying "youtube OK"
or search google by saying "google OK" Get prepared for making your own new form of using your computer.

You will need

-Windows Vista and up Machine (if you want voice activation. if not windows 98 or higher)
-5 minutes
-Microphone (If you want voice activation)

Step 1: Setup Speech Recognition

If you want to use speech recognition with this follow these instructions. If not, skip to step two.

Go to

Control Panel>Ease Of Access>Speech Recognition>Train your computer to better understand you

Follow the directions that it gives you and read the text aloud.

Step 2: Open Notepad

Press Winkey + R

Type in "notepad"

Hit enter

Step 3: Copy This Script Into Notepad (voice Activation)

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")

dim Input

wshshell.run "%windir%\Speech\Common\sapisvr.exe -SpeechUX"
Sapi.speak "Please speak, or type, what you want to open?"
Input=inputbox ("Please speak, or type, what you want to open.")





if Input = "youtube" OR Input = "Youtube"then
Sapi.speak "Opening youtube"
wshshell.run "www.youtube.com"

else
if Input = "instructables" OR Input = "Instructables" then
Sapi.speak "Opening instructables"
wshshell.run "www.instructables.com"

else
if Input = "google" OR Input = "Google" then
Sapi.speak "Opening google"
wshshell.run "www.google.com"

else
if Input = "command prompt" OR Input = "Command prompt" then
Sapi.speak "Opening command prompt"
wshshell.run "cmd"

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

else
if Input = "notepad" OR Input = "Notepad" then
Sapi.speak "Opening notepad"
wshshell.run "notepad"

else
if Input = "" then
else


Sapi.speak "I don't recognize your input, Please try something else"
end if
end if
end if
end if
end if
end if
end if

Step 4: Copy This Script Into Notepad (no Voice Activation)

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")

dim Input

Sapi.speak "Please type, what you want to open?"
Input=inputbox ("Please type, what you want to open.")





if Input = "youtube" OR Input = "Youtube"then
Sapi.speak "Opening youtube"
wshshell.run "www.youtube.com"

else
if Input = "instructables" OR Input = "Instructables" then
Sapi.speak "Opening instructables"
wshshell.run "www.instructables.com"

else
if Input = "google" OR Input = "Google" then
Sapi.speak "Opening google"
wshshell.run "www.google.com"

else
if Input = "command prompt" OR Input = "Command prompt" then
Sapi.speak "Opening command prompt"
wshshell.run "cmd"

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

else
if Input = "notepad" OR Input = "Notepad" then
Sapi.speak "Opening notepad"
wshshell.run "notepad"

else
if Input = "" then
else


Sapi.speak "I don't recognize your input, Please try something else"
end if
end if
end if
end if
end if
end if
end if

Step 5: Test the Script

Now save the script as assistant.vbs

Once the file has been saved run it, and it should tell you its ready for a command.

Say one of the options and then say OK.

It should open that option.

Step 6: Personalization

You can replace a chunk of code in here to open something else fairly easy. Lets start with one of the chunks, lets say, calculator.

else
if Input = "calculator" OR Input = "Calculator" then
Sapi.speak "Opening calculator"
wshshell.run "calc"

Say I want this to open bing.com

You have to change 4 parts.

else
if Input = "HERE" OR Input = "HERE" then
Sapi.speak "HERE"
wshshell.run "HERE"

The first one must be all lowercase. bing
The second one has a capital first letter Bing
The third is sapi speaking so something like Opening Bing
The fourth is the target www.bing.com


So it would look like this

else
if Input = "bing" OR Input = "Bing" then
Sapi.speak "Opening bing"
wshshell.run "www.bing.com"

!! Make sure everything has quotation marks around it or else it will be considered a variable not a text string!!

In case you were wondering why there was a capital and lowercase bing, it was so the program would recognize two common ways bing is written (with or without capitalization).



Step 7: Save and Test Again

Now that you have set the program to your liking, you can save it and run again. Test anything you set yourself to make sure it works. If it works move on. If it doesn't check your spelling or retry.  

Step 8: Yay!

Now that you have a shortcut program you can open youtube with two words. Get to google by speaking. This is very useful and fun to show to your friends. I don't want to see any comments saying "you could just use run" because you obviously didn't read through, since run doesn't automaticaly run sapi or speak after you open it. Anyways, thanks for reading.
                                                                                                                               
                                                                                                                             Super_Nerd

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

40 Comments

I would justlike to ask to me: is there a way to give it conversational abilities? For example:
Context:
Computer: Shall I open youtube?
Person: yes.
Computer: Ok.I will open youtube.

Context:
Computer:Want me to check the weather?
Person: Yes.
Computer:Ok.I will open youtube.

The actual question: Can I have EdEN (Thats what I call mine) say different things based on their context?

Although giving such a system conversational and contextual intelligence would be extremely difficult and complicated, it's certainly not impossible. I would certainly plan out exactly how you want EdEN to parse sentences because it's unrealistic to assume you can just make AI. I'd suggest using some of the VBS string features to search what the user says for key words and then go on from there. Please reply if I didn't quite answer your question.

Actually its Not I wrote one You teach as you go the more you interact the greater the conversational ability making its response decisions based on a mood degree deterimined by the interaction with it. you teach it what to say by whats being said to it and whether its good or bad. just like a child.

You want to create a form of Artificial Intelligence (AI). Good luck.

My question my be silly(I am a 9th Grader).....How to run this program and will this work in Bluej Java .Please help me out. I typed like this in the notepad but i cannot run it

Set Sapi = Wscript.CreateObject("SAPI.SpVoice")

set wshshell = wscript.CreateObject("wscript.shell")

dim Input

wshshell.run "%windir%\Speech\Common\sapisvr.exe -SpeechUX"

Sapi.speak "Please speak, or type, what you want to open?"

Input=inputbox ("Please speak, or type, what you want to open.")

if Input = "youtube" OR Input = "Youtube"then

Sapi.speak "Opening youtube"

wshshell.run "www.youtube.com"

else

if Input = "instructables" OR Input = "Instructables" then

Sapi.speak "Opening instructables"

wshshell.run "www.instructables.com"

else

if Input = "google" OR Input = "Google" then

Sapi.speak "Opening google"

wshshell.run "www.google.com"

else

if Input = "command prompt" OR Input = "Command prompt" then

Sapi.speak "Opening command prompt"

wshshell.run "cmd"

else

if Input = "calculator" OR Input = "Calculator" then

Sapi.speak "Opening calculator"

wshshell.run "calc"

else

if Input = "notepad" OR Input = "Notepad" then

Sapi.speak "Opening notepad"

wshshell.run "notepad"

else

if Input = "" then

else

Sapi.speak "I don't recognize your input, Please try something else"

end if

end if

end if

end if

end if

end if

end if

If some of you are interested in coding their ows personal assistant, here an example of a program I made using Python:

https://github.com/Valenti.../Jarvis-artificial-intelligence

It is coded in a structured way so that you can easily understaind and modify the code for your own needs, you need basic python knowledge.
Hoping that will help someone ;)

Could i get this to work on a phone?

No web page is opening....pls help

No web page is opening....pls help

how do i open a game with this.When i try to do that an error appears which tells that 'THE SYSTEM CANNOT FIND THE FILE SPECIFIED'.I am running windows xp