harryoui

Siri Shortcuts Windows Opener VBS

Sep 19th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function open(path)
  2.     Dim objShell
  3.     Set objShell = WScript.CreateObject("WScript.Shell")
  4.  
  5.     objShell.Run(path)
  6. End Function
  7.  
  8. Function readln()
  9.     Const ForReading = 1
  10.    
  11.     Set objFSO = CreateObject("Scripting.FileSystemObject")
  12.     If Not objFSO.FileExists("param.txt") Then
  13.         set objFile = objFSO.CreateTextFile("param.txt")
  14.         objFile.Write " "
  15.     End If
  16.    
  17.     set objTextFile = objFSO.OpenTextFile("param.txt", ForReading)
  18.     readln = objTextFile.ReadLine
  19. End Function
  20.  
  21.  
  22. a=Split(readln(), " and ")
  23. for each x in a
  24.         Select case Trim(LCase(x))
  25.             case "DICTATED-NAME"
  26.                 open("""PROGRAM-PATH""")
  27.         End select
  28. next
  29.  
  30. Set objShell = Nothing
Advertisement
Add Comment
Please, Sign In to add comment