これは、COM(コンポーネントオブジェクトモデル)を使用してMicrosoftオペレーティングシステム内のファイルを作成、読み取り、更新、および削除する単純なスクリプトです。 Windows 98はリリースされて以来、すべてのコンピュータにインストールされています。 VBScriptホスト環境は、Microsoft Script Controlを使用してプログラム内に組み込むことができるため、汎用性が高くなります。 Internet Information Services、Windows Script Host、およびInternet Explorerで頻繁に使用されます。
Dim message, sapi message=InputBox('What shall I say, your Geekness?','I speak for you.') Set sapi=CreateObject('sapi.spvoice') sapi.Speak message
コードが入力されたら、前述のようにファイルを "Text to Speech.vbs"として保存してスクリプトを完成させます。保存したら、その場所に移動してダブルクリックします。あなたは窓が「私はあなたのために話す」と呼ばれ、発声されるテキストを入力するプロンプトは「私の言うことは、あなたのオタク?」あなたはいつもあなたが望むものを言うようにこれらを変えることができます。
Set Sapi = Wscript.CreateObject('SAPI.SpVoice') dim str if hour(time) < 12 then Sapi.speak 'Good Morning Geekmeister ' else if hour(time) > 12 then if hour(time) > 16 then Sapi.speak 'Good evening Geekmeister ' else Sapi.speak 'Good afternoon Geekmeister ' end if end if end if
Set Sapi = Wscript.CreateObject('SAPI.SpVoice') Sapi.speak 'The current time is'
if hour(time) > 12 then Sapi.speak hour(time)-12 else if hour(time) = 0 then Sapi.speak '12' else Sapi.speak hour(time) end if end if
if minute(time) < 10 then Sapi.speak 'o' if minute(time) < 1 then Sapi.speak 'clock' else Sapi.speak minute(time) end if else Sapi.speak minute(time) end if
if hour(time) > 12 then Sapi.speak 'P.M.' else if hour(time) = 0 then if minute(time) = 0 then Sapi.speak 'Midnight' else Sapi.speak 'A.M.' end if else if hour(time) = 12 then if minute(time) = 0 then Sapi.speak 'Noon' else Sapi.speak 'P.M.' end if else Sapi.speak 'A.M.' end if end if end if
Set Sapi = Wscript.CreateObject('SAPI.SpVoice') dim str if hour(time) < 12 then Sapi.speak 'Good Morning Geekmeister ' else if hour(time) > 12 then if hour(time) > 16 then Sapi.speak 'Good evening Geekmeister ' else Sapi.speak 'Good afternoon Geekmeister ' end if end if end if Sapi.speak 'The current time is'
if hour(time) > 12 then Sapi.speak hour(time)-12 else if hour(time) = 0 then Sapi.speak '12' else Sapi.speak hour(time) end if end if
if minute(time) < 10 then Sapi.speak 'o' if minute(time) < 1 then Sapi.speak 'clock' else Sapi.speak minute(time) end if else Sapi.speak minute(time) end if
if hour(time) > 12 then Sapi.speak 'P.M.' else if hour(time) = 0 then if minute(time) = 0 then Sapi.speak 'Midnight' else Sapi.speak 'A.M.' end if else if hour(time) = 12 then if minute(time) = 0 then Sapi.speak 'Noon' else Sapi.speak 'P.M.' end if else Sapi.speak 'A.M.' end if end if end if