-
Notifications
You must be signed in to change notification settings - Fork 0
/
voice_rename.vb
45 lines (34 loc) · 1016 Bytes
/
voice_rename.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Sub Main(ByVal Param As Object)
Dim theCount
theCount = 0
Dim Debug As Boolean = False
Dim logName As String = "Voice_command: "
Dim dv As Scheduler.Classes.DeviceClass
Dim EN As Scheduler.Classes.clsDeviceEnumeration
EN = hs.GetDeviceEnumerator
If EN Is Nothing Then
hs.WriteLog(logName, "Error getting Enumerator")
Exit Sub
End If
Do
dv = EN.GetNext
If dv Is Nothing Then Continue Do
Dim s
Dim vc
Dim av
s = dv.name(Nothing)
vc = dv.voicecommand(Nothing)
av = dv.MISC_Check(Nothing, Enums.dvMISC.AUTO_VOICE_COMMAND)
If (av) Then
If (vc = "") Then
hs.writelog(logName, "Name: " & s)
hs.writelog(logName, "Voice: " & vc)
hs.writelog(logName, "Auto: " & av)
dv.voicecommand(Nothing) = dv.name(Nothing)
hs.writelog(logName, "Voice command copied for: " & s)
theCount += 1
End If
End If
Loop Until EN.Finished
hs.writelog(logName, theCount & " voice devices detected without command.")
End Sub