[jawsscripts] Re: Jamal's script library
- From: "Brian Hartgen" <jaws@xxxxxxxxxxx>
- To: <jawsscripts@xxxxxxxxxxxxx>
- Date: Sun, 23 Dec 2007 08:22:06 -0000
Hi Jamal
Thank you for putting these in the script library. I did not look carefully
enough so did not find your delete file function, so wrote my own instead,
together with my own get list of drives function. but that's OK. I did not
get to the sound devices one so I will try out the others. Again, thanks
for a great collection of functions, particularly the string analysis ones
which are extremely useful!
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jamal Mazrui
Sent: 23 December 2007 02:05
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Jamal's script library
I appreciate the feedback, which is gratifying and encouraging! I assume
that Brian found a solution to deleting a file via a JAWS script (e.g.,
with the FileDelete function in the Homer script library). I like a
programming challenge <grin>, so have tried to add functions to the
library that he found missing. I was able to add to Homer.jss the
function ShellGetDrives, which uses the Windows script host, and the
function BooShellGetSoundDevices, which uses IronCOM: a COM server that
provides access to the .NET Framework -- available at
http://www.EmpowermentZone.com/comsetup.exe
Below is the ShellGetDrives function, followed by the Boo script that is
called by the BooShellGetSoundDevices function. As usual, HomerKit is
available as an executable installer at
http://www.EmpowermentZone.com/kitsetup.exe
or as a zip archive (for manual or selective installation) at
the same URL except for a .zip extension,
http://www.EmpowermentZone.com/kitsetup.zip
In my opinion, Boo is currently the best scripting language for the .NET
Framework. IronCOM installs the latest distribution of this open source
language, including documentation. In addition, the EdSharp editor,
available at
http://www.EmpowermentZone.com/edsetup.exe
now includes a configuration for the Boo compiler (chosen with the Pick
Compiler command, Control+Shift+F5). This configuration assumes that
IronCOM has been installed at the default location,
C:\Program Files\IronCOM
Also, a new EdSharp command called Go to Environment, Control+Shift+G, is
set by default to open the Boo interpreter (similar to the Python
interactive environment), where one can test Boo expressions and scripts.
Let me know if you have further questions.
Cheers,
Jamal
String Function ShellGetDrives()
; Return a string sequence of drive letters that are ready for access
Var
Int i,
String sReturn, String sDrive, String sDrives,
Object oSystem, Object oDrive, Object oNull
Let oSystem = ObjectCreate("Scripting.FileSystemObject")
Let sDrives = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Let i = 1
While i <= 26
Let sDrive = Substring(sDrives, i, 1)
If oSystem.DriveExists(sDrive) Then
Let oDrive = oSystem.GetDrive(sDrive)
If oDrive.IsReady Then
Let sReturn = sReturn + sDrive
EndIf
Let oDrive = oNull
EndIf
Let i = i + 1
EndWhile
Let oSystem = oNull
Return sReturn
EndFunction
# Content of the file ShellGetSoundDevices.boo
# Located in the Homer subfolder of the user script folder
# Returns a \7 delimited string of sound devices,
# each segment being a | delimited pair of a device name and its
description
import System
import Microsoft.VisualBasic from Microsoft.VisualBasic.dll
sDelimiter = cast(Char, 7).ToString()
oService = Interaction.GetObject("""winmgmts:\\.\root\cimv2""", "")
oDevices = oService.ExecQuery("Select * from Win32_SoundDevice")
sDevices = ""
for o in oDevices: sDevices += o.Name + "|" + o.Description + sDelimiter
# End of ShellGetSoundDevices.boo
__________
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
__________
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
- References:
- [jawsscripts] Jamal's script library
- From: Brian Hartgen
- [jawsscripts] Re: Jamal's script library
- From: Jamal Mazrui
Other related posts:
- » [jawsscripts] Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- » [jawsscripts] Re: Jamal's script library
- [jawsscripts] Jamal's script library
- From: Brian Hartgen
- [jawsscripts] Re: Jamal's script library
- From: Jamal Mazrui