Finsihed Version 0.2.1 (Added TTS Engine + Fixed Some bugs+New Name). It’s still has a lots of bugs. Feedbacks are welcome.
TitleName := "X-RemindME v0.2.1 by ___x@___"
global IniFile := A_AppData "\X-RemindME_Settings.ini"
global SkipList := "Skip,Done,Expired"
ReturnDelimiter := Chr(251)
SeperateDelimiter := Chr(252)
MainGuiStatus := 1 ; 0=Hide 1=Show 2=Edit
#SingleInstance,Ignore
DetectHiddenWindows,On
Menu,TextToSpeech,Add,Enable,VoiceEnable
Menu,TextToSpeech,Add,Settings,ShowVoiceGui
Menu,Tray,Add,Show,ShowGui
Menu,Tray,Add,Add a Task,ShowAddGui
Menu,Tray,Add,Enable/Disable,EnableRemind
Menu,Tray,Add,Text To Speech,:TextToSpeech
Menu,Tray,Add,AutoRun,AutoRun
Menu,Tray,Add,About,AboutMe
Menu,Tray,Add,Exit,MainGuiClose
Menu,Tray,NoStandard
Menu,Tray,Default,Add a Task
IniRead,TempVar,% IniFile,Settings,IsSpeak,-1
if TempVar
{
if TempVar=-1
IniWrite,1,% IniFile,Settings,IsSpeak
Menu,TextToSpeech,Check,Enable
}
IniRead,TempVar,% IniFile,Settings,AutoRun,0
if TempVar
Menu,Tray,Check,AutoRun
if TempVar
StartRemind := 1
Gui, AddGui: Font, S10 CDefault,
Gui, AddGui: Add, GroupBox, x2 y0 w470 h80 , Time
Gui, AddGui: Add, DateTime, x12 y30 w290 h30 vDateTimeTask, 'Date: ' dd / MM / yyyy 'Time: ' hh : mm tt
Gui, AddGui: Add, GroupBox, x2 y80 w470 h110 , Message
Gui, AddGui: Add, Edit, x12 y100 w450 h80 vTaskMessage,
Gui, AddGui: Add, GroupBox, x2 y190 w470 h120 , Options
Gui, AddGui: Add, CheckBox, x22 y210 w310 h20 vEnableSoundC gEnableSound , Enable Sound
Gui, AddGui: Add, Edit, x32 y230 w340 h20 +ReadOnly vSoundPathE +Disabled,C:\Windows\Media\notify.wav
Gui, AddGui: Add, Button, x372 y230 w30 h20 vSoundBrowseB gSoundBrowser +Disabled, ...
Gui, AddGui: Add, Button, x402 y230 w30 h20 vSoundPlayB gSoundPlay +Disabled, >
Gui, AddGui: Add, Button, x432 y230 w30 h20 vSoundStopB gSoundStop +Disabled, [ ]
Gui, AddGui: Add, CheckBox, x22 y260 w310 h20 vEnableRunC gEnableRun, Run a Program
Gui, AddGui: Add, Edit, x32 y280 w340 h20 +ReadOnly vRunPathE +Disabled,
Gui, AddGui: Add, Button, x372 y280 w30 h20 vRunBrowseB +Disabled gRunBrowser, ...
Gui, AddGui: Add, Button, x82 y320 w100 h30 vDoneGoonB gDoneGoon, Done && Go on
Gui, AddGui: Add, Button, x182 y320 w100 h30 vDoneB gDone, Done
Gui, AddGui: Add, Button, x282 y320 w100 h30 vCancelB gAddGuiGuiClose, Cancel
GuiControlGet, EnableSoundHwnd,AddGui: Hwnd,EnableSoundC
GuiControlGet, EnableRunHwnd,AddGui: Hwnd,EnableRunC
Gui, Main: Font, S10 CDefault,
Gui, Main: Add, MonthCal, x2 y10 w250 h180 vDateMain gLoad +AltSubmit ,
Gui, Main: Add, ListView, x262 y20 w620 h370 +AltSubmit gMainLV +Sort , Time|Task|Status|Sound|Run Program
Gui, Main: Add, Button, x22 y200 w200 h30 vAddTaskB gShowAddGui, Add A Task
Gui, Main: Add, Button, x22 y240 w200 h30 vEditTaskB gShowEditGui +Disabled, Edit
Gui, Main: Add, Button, x22 y280 w200 h30 vDelTaskB +Disabled gDelTask, Delete
Gui, Main: Add, GroupBox, x252 y0 w640 h400 vTaskInfo, Task List
Gui, Main: Add, Button, x22 y320 w200 h30 gEnableRemind vEnableB, Enable
Gui, Main: Add, Button, x22 y360 w200 h30 gHideGui, Hide
Gui, Main: Show, x189 y87 h416 w905,% TitleName
Gui, Main:Default
SetTimer,Update,60000
gosub,Load
Return
Load:
Gui, Main:Default
LV_Delete()
GuiControlGet,DateMain,,DateMain
DateMain := SubStr(DateMain,1,8)
GuiControl,,TaskInfo,% "Task List -" SubStr(DateMain,7) "/" SubStr(DateMain,5,2) "/" SubStr(DateMain,1,4)
TimeList := GetAllKeys(DateMain)
if !TimeList
return
Loop,Parse,TimeList,CSV
{
IniRead,TempVar,% IniFile,% DateMain, % A_LoopField,-1
if (TempVar=-1)
continue
StringSplit,TempVar,TempVar,% SeperateDelimiter
StringReplace,TempVar1,TempVar1,% ReturnDelimiter,`n,All
LV_Add("",SubStr(A_LoopField,1,2) ":" SubStr(A_LoopField,3),TempVar1,TempVar2,TempVar3,TempVar4)
Loop 4
LV_ModifyCol(A_Index,"AutoHdr")
}
SetTimer,StartRemind,Off
SetTimer,ShowMessage,Off
if StartRemind
SetTimer,StartRemind,-10
return
EnableRemind:
if StartRemind
{
StartRemind :=0
SetTimer,StartRemind,Off
SetTimer,ShowMessage,Off
GuiControl,Main:,EnableB,Enable
TrayTip,% TitleName,Disabled!,1,3
return
}
TrayTip,% TitleName,Enabled!,1,2
GuiControl,Main:,EnableB,Disable
StartRemind := 1
StartRemind:
DateNow := SubStr(A_Now,1,8)
TimeTask := SubStr(A_Now,9,4)
NextTime := NextTime(DateNow,TimeTask)
if (!NextTime && NextTime<>"0000")
{
;~ TrayTip,% TitleName,All Done!,1,1
StartRemind :=-1
return
}
WaitTime := ((SubStr(NextTime,1,2)-SubStr(TimeTask,1,2))*60 + SubStr(NextTime,3)-SubStr(TimeTask,3) + GetSnoozeTime(DateNow,NextTime))*60
TrayTip,% TitleName,% "You have a Task to do in " Floor(WaitTime/60) " Minute(s)",1,1
if WaitTime
WaitTime -= A_Sec +1
SetTimer,ShowMessage,% -WaitTime*1000-1
return
ShowMessage:
SetStatus("Done",DateNow,NextTime)
IniRead,Info,% IniFile,% DateNow,% NextTime,% A_Space
StringSplit,Info,Info,% SeperateDelimiter
StringReplace,Info1,Info1,% ReturnDelimiter,`n,All
SoundPlay,% Info3
if Info4
Run,% Info4,,UseErrorlevel
gosub,ShowMessageGui
gosub,Load
SetTimer,StartRemind,-10
return
ShowMessageGui:
Gui, Snooze%DateNow%%NextTime%: Font, S11 CDefault, Verdana
Gui, Snooze%DateNow%%NextTime%: +AlwaysOnTop -SysMenu
Gui, Snooze%DateNow%%NextTime%: Add, Text, x22 y10 w350 h20 , Task Message:
Gui, Snooze%DateNow%%NextTime%: Add, Edit, x12 y40 w510 h250 +ReadOnly ,% Info1
Gui, Snooze%DateNow%%NextTime%: Add, Button, x12 y300 w100 h30 gSnooze , Snooze!
Gui, Snooze%DateNow%%NextTime%: Add, Edit, x112 y300 w100 h30 +number , 5
Gui, Snooze%DateNow%%NextTime%: Add, UpDown, Range1-9999,5
Gui, Snooze%DateNow%%NextTime%: Add, Button, x422 y300 w100 h30 gDestroyMe, Close
Gui, Snooze%DateNow%%NextTime%: Add, Button, x402 y5 w60 h30 gSpeakMe, Speak
Gui, Snooze%DateNow%%NextTime%: Add, Button, x462 y5 w60 gStopSpeakMe, Stop
Gui, Snooze%DateNow%%NextTime%: Show, w537 h345,% "Alrm - " SubStr(NextTime,1,2) ":" SubStr(NextTime,3) " - " TitleName
GuiControlGet, SpeakID,Snooze%DateNow%%NextTime%: Hwnd,Button3
IniRead,TempVar,% IniFile,Settings,IsSpeak,0
if TempVar
ControlClick,,ahk_id %SpeakID%
return
SpeakMe:
GuiControlGet,SpeakMe, %A_Gui%:,Edit1
Speak("The time is " SubStr(A_Now,9,2)+0 " " SubStr(A_Now,11,2)+0 "... And Your task is ... " SpeakMe)
return
StopSpeakMe:
SoundPlay,C:\___x@___.mp32
Speak()
return
Snooze:
TimeTask := SubStr(A_Gui,7)
TimeThen := TimeTask
GuiControlGet,SnoozeTime,%A_Gui%:,Edit2
EnvSub,TimeTask,%A_Now%,M
TimeTask *= -1
EnvAdd,TimeThen,% TimeTask+SnoozeTime,M
if (TimeThen > A_YYYY A_MM A_DD 235900)
{
Gui %A_Gui%: +OwnDialogs
MsgBox, 52, % "WARNING - " TitleName, % "Can not snooze until " ShowDateTime(TimeThen) "`nThe time you choose is too large!`nHowever, would you like to Add This Task to That Day?"
IfMsgBox,No
return
IniRead, TempVar,% IniFile,% SubStr(A_Gui,7,8),% SubStr(A_Gui,15),0
if !TempVar
{
Gui %A_Gui%: +OwnDialogs
MsgBox,,ERROR!,Sorry, Your Task has been Deleted!
return
}
if AddTask(TempVar,SubStr(TimeThen,1,8), SubStr(TimeThen,9,4))
return
SetStatus("Waiting",SubStr(TimeThen,1,8), SubStr(TimeThen,9,4))
}
else SetStatus("Snooze`," TimeTask+SnoozeTime,SubStr(A_Gui,7,8),SubStr(A_Gui,15))
Gui, %A_Gui%: Destroy
gosub,Load
return
DestroyMe:
SetStatus("Done",SubStr(A_Gui,7,8),SubStr(A_Gui,15))
Gui, %A_Gui%: Destroy
gosub,StopSpeakMe
return
AboutMe:
MsgBox, 262208, % TitleName, Name: X-RemindME v0.2.1`nAuthor: ___x@___`nEmail: anhnhoktvn@gmail.com`nDate Created : 16/01/12
return
Update:
if (CurrentDate=A_DD)
return
CurrentDate := A_DD
if StartRemind
SetTimer,StartRemind,-10
return
VoiceEnable:
IniRead,TempVar,% IniFile,Settings,IsSpeak,0
if TempVar
{
Menu,TextToSpeech,UnCheck, Enable
IniWrite,0,% IniFile,Settings,IsSpeak
return
}
Menu,TextToSpeech,Check, Enable
IniWrite,1,% IniFile,Settings,IsSpeak
return
AutoRun:
IniRead,TempVar,% IniFile,Settings,AutoRun,0
if TempVar
{
Menu,Tray,UnCheck, AutoRun
IniWrite,0,% IniFile,Settings,AutoRun
RegDelete,HKCU,Software\Microsoft\Windows\CurrentVersion\Run,X-RemindMe
return
}
Menu,Tray,Check, AutoRun
IniWrite,1,% IniFile,Settings,AutoRun
RegWrite,REG_SZ,HKCU,Software\Microsoft\Windows\CurrentVersion\Run,X-RemindMe,% A_ScriptFullPath
return
MainLV:
Gui,Main:Default
SelectedRow := LV_GetNext()
GuiControl, Enable%SelectedRow%,EditTaskB
GuiControl, Enable%SelectedRow%,DelTaskB
return
DelTask:
Gui,Main:Default
GuiControlGet,DateMain,,DateMain
DateMain := SubStr(DateMain,1,8)
Loop, % LV_GetCount("S")
{
LV_GetText(TimeTask,LV_GetNext(),1)
StringReplace,TimeTask,TimeTask,:
DelTask(DateMain,TimeTask)
LV_Delete(LV_GetNext())
}
return
#If IsFocusMainLV()
^a::
Gui,Main:Default
Loop, % LV_GetCount()
LV_Modify(A_Index,"Select")
return
Del:: gosub,DelTask
#If IsExistGui()
return
HideGui:
MainGuiStatus:=0
Gui,Main: Hide
return
ShowGui:
MainGuiStatus:=1
Gui,Main: Show
return
ShowVoiceGui:
GuiControlGet,ISExistShowVoiceGui,VoiceSetting:,Static1
if ISExistShowVoiceGui
{
Gui, VoiceSetting:Show
return
}
IniRead,VoiceName,% IniFile,Settings,VoiceName,0
IniRead,VoiceSpeed,% IniFile,Settings,VoiceSpeed,0
IniRead,VoiceVol,% IniFile,Settings,VoiceVol,100
Gui, VoiceSetting:Font, S10 CDefault, Verdana
Gui, VoiceSetting:Add, Text, x12 y10 w70 h20 , Voice:
Gui, VoiceSetting:Add, DropDownList, x91 y8 w290 h20 vVoiceName +R10, % VoiceNameList() "||"
Gui, VoiceSetting:Add, Text, x12 y40 w70 h20 , Speed:
Gui, VoiceSetting:Add, Slider, x92 y40 w340 h30 vVoiceSpeed +ToolTip +TickInterval1 Range-10-10, % VoiceSpeed
Gui, VoiceSetting:Add, Text, x12 y80 w70 h20 , Volume:
Gui, VoiceSetting:Add, Slider, x92 y80 w340 h30 vVoiceVol +ToolTip +TickInterval10 Range0-100, % VoiceVol
Gui, VoiceSetting:Add, Button, x385 y8 w50 h24 gReloadVoice, Reload
Gui, VoiceSetting:Add, Button, x92 y120 w70 h30 gDefaultVoice, Default
Gui, VoiceSetting:Add, Button, x172 y120 w70 h30 gDoneVoice, Done
Gui, VoiceSetting:Add, Button, x252 y120 w70 h30 gTestVoice, Test
Guicontrol,VoiceSetting:ChooseString,VoiceName,% VoiceName
Gui, VoiceSetting:Show, x189 y87 h165 w448, Text To Speech - %TitleName%
return
VoiceSettingGuiClose:
VoiceID:=""
Gui, VoiceSetting: Destroy
return
DefaultVoice:
GuiControl,VoiceSetting:,VoiceSpeed,0
GuiControl,VoiceSetting:,VoiceVol,100
return
ReloadVoice:
GuiControl,VoiceSetting:,VoiceName, % "|" VoiceNameList() "||"
return
DoneVoice:
TestVoice:
Gui, VoiceSetting:Submit,Nohide
IniWrite,% VoiceName,% IniFile,Settings, VoiceName
IniWrite,% VoiceSpeed,% IniFile,Settings, VoiceSpeed
IniWrite,% VoiceVol,% IniFile,Settings, VoiceVol
if (A_ThisLabel="DoneVoice") {
gosub,VoiceSettingGuiClose
return
}
Speak("This is a test. Do you like it?")
return
MainGuiClose:
Gui +OwnDialogs
MsgBox,36,Confirm - %TitleName%,Are you sure to quit ?
IfMsgBox,Yes
ExitApp
return
ShowEditGui:
Gui,Main:Default
SelectedRow := LV_GetNext()
if !SelectedRow
{
GuiControl, Disable,EditTaskB
GuiControl, Disable,DelTaskB
return
}
MainGuiStatus := 2
LV_GetText(TimeTask,SelectedRow,1)
LV_GetText(TaskMessage,SelectedRow,2)
LV_GetText(Status,SelectedRow,3)
LV_GetText(SoundPathE,SelectedRow,4)
LV_GetText(RunPathE,SelectedRow,5)
StringReplace,TimeTask_Old,TimeTask,:
Gui,Submit
DateMain := SubStr(DateMain,1,8)
Gui, AddGui:Default
GuiControl, ,DateTimeTask,% DateMain TimeTask_Old "00"
GuiControl,,TaskMessage,% TaskMessage
GuiControl,,SoundPathE,% SoundPathE
GuiControl,,RunPathE,% RunPathE
if SoundPathE
Control,Check,,,ahk_id %EnableSoundHwnd%
else
Control,UnCheck,,,ahk_id %EnableSoundHwnd%
if RunPathE
Control,Check,,,ahk_id %EnableRunHwnd%
else
Control,UnCheck,,,ahk_id %EnableRunHwnd%
Gui, AddGui: Show,Restore, Edit Task
return
ShowAddGui:
if MainGuiStatus
Gui,Main: Hide
Gui, AddGui:Default
Gui, AddGui: Show,Restore, Add Task
return
return
RunBrowser:
Gui +OwnDialogs
FileSelectFile, SFile,3 , %Root%, Choose A Program - %TitleName%
if !SFile
return
SplitPath,SFile,,Root
GuiControl,AddGui:,RunPathE, %SFile%
return
SoundBrowser:
Gui +OwnDialogs
FileSelectFile, SFile, , %Root%,Choose A Sound File - %TitleName% , Media Files (*.wav;*.mp3)
if !SFile
return
SplitPath,SFile,,Root,Ext
if Ext not in wav,mp3
return
GuiControl,AddGui:,SoundPathE, %SFile%
return
SoundStop:
SoundPlay,C:\___x@___.mp32
return
SoundPlay:
GuiControlGet,SoundPathE,AddGui:,SoundPathE
IfExist,%SoundPathE%
SoundPlay,%SoundPathE%
return
EnableSound:
GuiControlGet, EnableSoundC,AddGui:,EnableSoundC
GuiControl,AddGui: Enable%EnableSoundC%,SoundPathE
GuiControl,AddGui: Enable%EnableSoundC%,SoundBrowseB
GuiControl,AddGui: Enable%EnableSoundC%,SoundPlayB
GuiControl,AddGui: Enable%EnableSoundC%,SoundStopB
return
EnableRun:
GuiControlGet, EnableRunC,AddGui:,EnableRunC
GuiControl,AddGui: Enable%EnableRunC%,RunPathE
GuiControl,AddGui: Enable%EnableRunC%,RunBrowseB
return
DoneGoon:
Done:
Gui, AddGui:Default
Gui, Submit, Nohide
if !TaskMessage
{
TrayTip,% TitleName,Please Add a Message,1,2
return
}
Date := SubStr(DateTimeTask,1,8)
TimeTask := SubStr(DateTimeTask,9,4)
Status := "Waiting"
if (SubStr(DateTimeTask,1,12) < SubStr(A_Now,1,12))
{
Status := "Expired"
Gui + OwnDialogs
MsgBox,52, WARNING! ,You have chosen a Time period in the past.Do you want to continue?
IfMsgBox,No
return
}
if !EnableSoundC
SoundPathE := ""
if !EnableRunC
RunPathE := ""
SoundPathE := Trim(SoundPathE)
RunPathE := Trim(RunPathE)
StringReplace,TaskMessage,TaskMessage,`n,% ReturnDelimiter,All
if AddTask(TaskMessage SeperateDelimiter Status SeperateDelimiter SoundPathE SeperateDelimiter RunPathE,Date,TimeTask,MainGuiStatus-2)
return
if (MainGuiStatus=2)
{
TrayTip,% TitleName,Edited a Task,1,1
if (TimeTask_Old<>TimeTask)
DelTask(DateMain,TimeTask_Old)
MainGuiStatus := 1
Gui,Show,,Add Task
}
else TrayTip,% TitleName,Added a new Task,1,1
GuiControl, , TaskMessage,
EnvAdd, DateTimeTask,5,m
GuiControl, , DateTimeTask,% DateTimeTask
if StartRemind
SetTimer,StartRemind,-1
if !(A_ThisLabel="Done")
return
AddGuiGuiClose:
Gui,AddGui: Hide
Gui, Main:Default
if !MainGuiStatus
return
gosub,Load
Gui,Show,Restore
return
#If IsFocusDateTime()
WheelDown::SendEvent {Down}
WheelUp::SendEvent {Up}
GetAllSections()
{
FileRead,IniContent,% IniFile
Loop,parse,IniContent,`n,`r
{
if (Substr(A_LoopField,1,1)="[") && (Substr(A_LoopField,StrLen(A_LoopField),1)="]")
if (Sections="")
Sections := Substr(A_LoopField,2,StrLen(A_LoopField)-2)
else Sections .= "," Substr(A_LoopField,2,StrLen(A_LoopField)-2)
}
return Sections
}
GetAllKeys(Section)
{
FileRead,IniContent,% IniFile
Loop,parse,IniContent,`n,`r
{
LineContent := Trim(A_LoopField)
if !Start
if (LineContent="[" Section "]")
{
Start := 1
continue
}
else continue
if (Substr(LineContent,1,1)="[") && (Substr(LineContent,StrLen(LineContent),1)="]")
return Keys
if !(Pos := InStr(LineContent,"="))
continue
if (Keys="")
Keys := Substr(LineContent,1,InStr(LineContent,"=")-1)
else Keys .= "," Substr(LineContent,1,InStr(LineContent,"=")-1)
}
return Keys
}
DelTask(Section,Key)
{
IniDelete,% IniFile,% Section,% Key
if !GetAllKeys(Section)
IniDelete,% IniFile,% Section
}
IsFocusDateTime()
{
GuiControlGet,Focus,AddGui: Focus
if Focus contains SysDateTimePick
return 1
else return 0
}
IsFocusMainLV()
{
GuiControlGet,Focus,Main: Focus
if Focus contains SysListView
return 1
else return 0
}
NextTime(Section,TimeNow)
{
TimeList := GetAllKeys(Section)
Loop,Parse,TimeList,CSV
{
TempVar := GetStatus(Section,A_LoopField)
if TempVar in %SkipList%
continue
TimeCompare := GetMinute(A_LoopField) + GetSnoozeTime(Section,A_LoopField) - GetMinute(TimeNow)
if (TimeCompare=0)
return A_LoopField
else if (TimeCompare>0) {
if !MinResult {
MinResult := TimeCompare
Result := A_LoopField
}
else if (TimeCompare<MinResult) {
MinResult := TimeCompare
Result := A_LoopField
}
}
else if InStr(TempVar,"Snooze")
SetStatus("Done",Section,A_LoopField)
else SetStatus("Expired",Section,A_LoopField)
}
return, Result
}
GetStatus(Section,Time)
{
global SeperateDelimiter
IniRead,TempVar,% IniFile,% Section,% Time,% A_Space
StringSplit,TempVar,TempVar,% SeperateDelimiter
return TempVar2
}
SetStatus(Status,Section,Key)
{
global SeperateDelimiter
IniRead,TempVar,% IniFile,% Section,% Key,% A_Space
StringReplace,TempVar,TempVar,% SeperateDelimiter GetStatus(Section,Key) SeperateDelimiter,% SeperateDelimiter Status SeperateDelimiter
IniWrite,% TempVar,% IniFile,% Section,% Key
}
GetSnoozeTime(Section,Time)
{
Status := GetStatus(Section,Time)
StringSplit,Status,Status,`,
Status2+=0
return Status2
}
GetMinute(Time)
{
return SubStr(Time,1,2)*60 + SubStr(Time,3)
}
IsExistGui()
{
global TitleName
DetectHiddenWindows,On
IfWinExist,% TitleName
return 1
return 0
}
AddTask(Info,Date,Time,AskDuplicate=1)
{
IniRead,TempVar,% IniFile,% Date,% Time,0
if (TempVar && AskDuplicate)
{
Gui %A_Gui%: +OwnDialogs
MsgBox,36,Duplicate! - %TitleName%,You have a Task to do at this Time!`nDo you want to Replace it?
IfMsgBox,No
return 1
}
IniWrite,% Info,% IniFile,% Date,% Time
return 0
}
ShowDateTime(Time)
{
return, SubStr(Time,7,2) "/" SubStr(Time,5,2) "/" SubStr(Time,1,4) " " SubStr(Time,9,2) ":" SubStr(Time,11,2)
}
VoiceNameList()
{
TempObj := ComObjCreate("SAPI.SpVoice")
Loop, % TempObj.GetVoices.Count -1
if !VoiceName
VoiceName := TempObj.GetVoices.Item(A_Index-1).GetAttribute("Name")
else
VoiceName .= "|" TempObj.GetVoices.Item(A_Index-1).GetAttribute("Name")
TempObj:= ""
return VoiceName
}
Speak(Text="")
{
static VoiceID
IniRead,VoiceName,% IniFile,Settings,VoiceName,0
IniRead,VoiceSpeed,% IniFile,Settings,VoiceSpeed,0
IniRead,VoiceVol,% IniFile,Settings,VoiceVol,100
VoiceID := ComObjCreate("SAPI.SpVoice")
if VoiceName
VoiceID.Voice := VoiceID.GetVoices("Name=" VoiceName).Item(0)
VoiceID.Rate := VoiceSpeed
VoiceID.Volume := VoiceVol
VoiceID.Speak("",0x1|0x2)
VoiceID.Speak(Text,0x1)
SetTimer,IsDone,-1
return
IsDone:
loop
if VoiceID.WaitUntilDone(100) OR !VoiceID
break
return
}




