How do I use the Scriptomatron 4000?

This is a commonly asked question, especially from people new to the Scriptomatron 4000. Usage is very simple and straightforward. The advanced “Human Language Text Processor” (HLTP) can interpret and parse requirements given in everyday speech transcripted into text. Below is an example query which will be automatically parsed by the Scriptomatron 4000′s HLTP and it will respond with the script as a subsequent comment. Script requests can also be input as comments onto other posts.

Example:

Hello Scriptomatron 4000, I need a script.

Here are my requirements:
GUI interface which accepts three text inputs and a button labeled Submit. The text inputs should be labeled as such:
Job Type
Job Number
Customer Name

Upon pressing the “submit” button, the script should create a directory structure based on the provided data, along with some substructure to be determined later.

For example, the directory to be created should be: C:\test\Job(job number)(customer name).(job type).

This script will be used on a Windows XP computer and should require no other software to be installed along with it.

Please have this script ready for as soon as possible.

Thanks,

Some Admin.

Advertisement

One Response to How do I use the Scriptomatron 4000?

  1. scriptomatron4000 says:

    Requirements: Visual Basic Script, HTA support
    Filename: script.hta
    Generation time: 0.4s

    Thank you for using the Scriptomatron 4000, your input is greatly valued.

    Copy and paste the following information into a file to create your script:

    <head>
    <title>Create Folder</title>
    <HTA:APPLICATION
    APPLICATIONNAME=”Test HTA”
    SCROLL=”no”
    SINGLEINSTANCE=”yes”
    >
    </head>

    <script language=”VBScript”>

    Option Explicit
    Dim objFSO, objFolder, objShell, strDirectory, strRoot, jobt, custn, jobn
    Set objShell = CreateObject(“WScript.Shell”)
    Set objFSO = CreateObject(“Scripting.FileSystemObject”)

    // ———————————————————————-
    // This value is the root for the created folders.
    // Do not put a slash at the end.

    strRoot = “C:\TEST”

    // ———————————————————————-

    Sub submit
    jobt = jobtype.value
    custn = customername.value
    jobn = jobnumber.value
    strDirectory = strRoot + “\” + “Job” + jobn + custn + “.” + jobt
    ‘ Note If..Exists. Then, Else … End If construction
    If objFSO.FolderExists(strDirectory) Then
    Set objFolder = objFSO.GetFolder(strDirectory)

    MsgBox strDirectory & ” already created.”

    ElseIf jobn = “” then
    MsgBox “Please enter a job number.”
    Exit Sub

    ElseIf custn = “” then
    MsgBox “Please enter a customer name.”
    Exit Sub

    ElseIf jobt = “” then
    MsgBox “Please enter a job type.”
    Exit Sub
    Else
    Set objFolder = objFSO.CreateFolder(strDirectory)

    // ———————————————————————-
    // Copy and paste these lines and change the last value to
    // add folders beneath the new one.

    Set objFolder = objFSO.CreateFolder(strDirectory + “\ExampleOne”)
    Set objFolder = objFSO.CreateFolder(strDirectory + “\ExampleTwo”)

    // ———————————————————————-

    MsgBox “Successfully created ” & strDirectory
    End If

    If err.number = vbEmpty then
    Set objShell = CreateObject(“WScript.Shell”)
    objShell.run (“Explorer” &” ” & strDirectory & “\” )
    Else MsgBox “VBScript Error: ” & err.number
    End If

    End Sub

    Sub window_onload
    window.resizeTo 400,300
    End Sub

    </script>

    <body style=”background-color:#B0C4DE; font-family: arial”>
    <h1> <center>
    Create Folder </center></h1>

    <center>
    <table>
    <tr>
    <td>
    <p> Job Number:</p>
    </td>
    <td>
    <input type=”text” name=”jobnumber” size=”30″>
    </td>
    </tr>
    </table>

    <table>
    <tr>
    <td>
    <p>Customer Name:</p>
    </td>
    <td>
    <input type=”text” name=”customername” size=”20″>
    </td>
    </tr>
    </table>

    <table>
    <tr>
    <td>
    <p>Job Type:</p>
    </td>
    <td>
    <input type=”text” name=”jobtype” size=”20″>
    </td>
    </tr>
    </table>

    <br />

    <table>
    <tr>
    <td>
    <input id=1 class=”button” type=”button” name=”btnSubmit”
    value=”Submit” style=”height:30px; width=60px; font-size=16;
    background-color=#00008B; color=white” onClick=”Submit”>
    </td>
    </tr>
    </table>
    </center>

    </body>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.