Monday, October 24, 2005
Planet PDF - OCR Tutorial for Acrobat
I Sys 531 Notes
Options Explicit 'Tells the compiler that you must delare the variable before they are used.
WScript.Quit - exits the script
Arguments are what are passed in
WScript.Echo(WScript.Arguments.Count)
For Each arg In WScript.Arguments
WScript.Echo(arg)
Next
WScript.Echo(WSrcipt.Arguments(2)) 'Indicates the 3rd element in the collection of arguments.
Input Box
Prompt="Enter Your Name"
Title="Name"
Answer=InputBox(Prompt,Title,"Gomer") 'Gomer is the default in this case. You can leave it empty. You can also put a location argument at the end.
WScript.Echo(Answer)
Command Line Input and Output
WScript.StdOut.Write("What is your Quest")
Answer=WScript.StdIn.ReadLine
WScript.Echo(Answer)
Prompt="Select source folder"
Set oShell=WSCript.CreateObject("Shell.Application")
Set oFolder=oShell.BrowseForFolder(0,Prompt,0,"C:\")
Set oFile=oFolder.Items.Item
WScript.Echo(oFile.path)
Set oOFD=WScript.CreateObject("UserAccounts.CommonDialog")
oOFD.Filter="VB Script|*.vbs|Text Files|*.txt|All Files|*.*"
oOFD.FilterIndex=2
oOFD.InitialDir="C:\"
Result-oOFD.ShowOpen
If Result Then
WSCript.Echo(You chose " & oOFD.FileName)
Else
WScript.Echo("No File Selected")
End If
WScript.FullName will report the scripting engine running the current Script
WScript.Quit - exits the script
Arguments are what are passed in
WScript.Echo(WScript.Arguments.Count)
For Each arg In WScript.Arguments
WScript.Echo(arg)
Next
WScript.Echo(WSrcipt.Arguments(2)) 'Indicates the 3rd element in the collection of arguments.
Input Box
Prompt="Enter Your Name"
Title="Name"
Answer=InputBox(Prompt,Title,"Gomer") 'Gomer is the default in this case. You can leave it empty. You can also put a location argument at the end.
WScript.Echo(Answer)
Command Line Input and Output
WScript.StdOut.Write("What is your Quest")
Answer=WScript.StdIn.ReadLine
WScript.Echo(Answer)
Prompt="Select source folder"
Set oShell=WSCript.CreateObject("Shell.Application")
Set oFolder=oShell.BrowseForFolder(0,Prompt,0,"C:\")
Set oFile=oFolder.Items.Item
WScript.Echo(oFile.path)
Set oOFD=WScript.CreateObject("UserAccounts.CommonDialog")
oOFD.Filter="VB Script|*.vbs|Text Files|*.txt|All Files|*.*"
oOFD.FilterIndex=2
oOFD.InitialDir="C:\"
Result-oOFD.ShowOpen
If Result Then
WSCript.Echo(You chose " & oOFD.FileName)
Else
WScript.Echo("No File Selected")
End If
WScript.FullName will report the scripting engine running the current Script