|

Sample Scripts
NOTE: These are examples of how to use scripts to interact with the Summation Blaze LG object model, and are not meant to be used as general solutions.
Backup the Case Organizer
This script uses the File System Object which is an object-based tool for working with files and folders. If a CaseOrgBkups folder is not available, it will create one in \Profiles\AllUsers. Then it gets the current date from the system settings and strips the slashes out to create a valid filename. It uses that modified date setting as the backup folder name into which it copies the entire CaseOrg folder and stores the backups in the CaseOrgBkups folder.
If a folder with that modified date name already exists in the CaseOrgBkups folder, it will append a number to the end of the foldername and that number will be incremented until it finds a non-existing name (e.g. if there already is a folder titled 021601 the backup will create one named 021601-1, if that exists then one named 021601-2 will be created, etc).
Clean Up Case Organizer Backups
This script allows users to easily dispose of old Case Organizer backup folders within the CsOrgBkups folder. It prompts the user for the cutoff date. Any folders within the CsOrgBkups folder that have been created prior to that date will be deleted. (If they are deleted in error, they can be retrieved from the recycle bin). Folders created ON the date entered by the user will NOT be deleted. Note that this script operates on the date created not the date modified.
ImageVerify
This script verifies that the images in the Core database are actually physically present in the location that Summation is looking for them. If the images are not located on the path in the ImgInfo table, this script will create a file that contains the DocId number and the path to the image (including filename). The script will give the option to view the file/report at the end of the script. If the user chooses not to view the file right away, then a message box will appear telling them where the file can be found. The file is overwritten with each run of the script so there will not be a multitude of them to clean up periodically. The script can be modified to create multiple files so that each will not be overwritten by the last in much the same way that the Case Organizer backup script creates multiple backups.
RefreshHasImageTags
This script operates in the same way the Refresh HasImage Tags operation did in 5.x systems. It loops through the current table of the Core database and the ImgInfo table to see if a record has a corresponding image record. If it does, then a Yes value is placed in the HasImage field of the current table. If there is no corresponding image record, then the HasImage field is cleared.
Restore the Case Organizer
This script uses the File System Object. It will prompt the user for the date from which to back up. If there are multiple backups from that date it will prompt the user if they wish to back up with the most recent from that date. If they choose no, then they will have to input the folder name that they want to use to restore.
ScriptInHTML
This example (written in Javascript) shows how users can access the Scripting Object via an HTML page within Summation. In this example, the script within the HTML page gets data about the current case from Blaze LG and displays it in the HTML page when the button is clicked.
In order to see this script work in your version of Blaze LG, right-click the 'Download' link provided beneath the Code section and select 'Save Target as...' Save the file to your Summation application directory. To see the script in action, copy and paste the below line into your scripting window and run the script.
AddHTMLTab "ScriptInHTML", AppDir & "ScriptInHTML.htm"
To see the script in action, copy and paste the below line into your scripting window and run the script.
SearchAndHiliteWordDoc
This script will open the specified Word document and search for the term within the Word document. If it finds the search term, then it will bold the text of the hit and change the font color to red.
This is a multi-purpose example. It can be run as a simple script by removing the apostrophe (un-commenting out) before the ‘Sub SearchAndHiliteWordDoc(FilePath, SrchTerm) line and inserting a valid path and filename as the argument; but it was written with something even more useful in mind.
The script also takes advantage of the subs.vs feature. If there is a file in the application directory called subs.vs, Summation will pre-load the sub-routines contained in that file so that they may be called simply within the application.
For instance, if you save this script as Subs.vs in the Application directory and then launch Summation, the subroutine will be preloaded. After you have done this, say you wanted to link a line in a transcript to a Word document. You could highlight the line in the transcript and right click on it. Then select Create Link. Click on Windows Document and browse to the file that you want connected to this link. Now, in order to have the script trigger when you click on the link instead of just having the windows document open, you would click on the Advanced button and replace the “OpenWindowsDocument” with SearchAndHiliteWordDoc. You must also add a comma after the path listed and either enter a search term in quotes or enter SearchString (then it will search for the term in the Quick Search Box). So the line in your Advanced dialog box should look something like:
SearchAndHiliteWordDoc “C:\My Documents\MyWordDoc.doc”, SearchString
Or
SearchAndHiliteWordDoc “C:\My Documents\MyWordDoc.doc”, “A Search Phrase”
Then click OK and if you have already preloaded the subs.vs, click on the link. Your Word Document should open and if there were any hits, they should now be bold and red.
The scripting kit currently has the Advanced dialog box as read-only (this will be changed) but the action can be set via scripting. If you want to adjust the first link on the page then enter something like this in the Scriptinng dialog (with the transcript as the active view) and run the script:
Set T = Views.ActiveView
T.Links(1).Action "SearchAndHiliteWordDoc " & Chr(34) & "File/path" & Chr(34) & ", " & SearchString)
T.Links(1).Tip "SearchAndHiliteWordDoc Test”
SpellCheck Note and/or Core Databases
This Script requires that Microsoft Word be installed on the computer running the Spellchecker. It will launch the spellchecker that exists in Word and run the Summation database through it. The script will load (create If necessary) a Case Specific Custom Dictionary and sets it as the primary dictionary for this Case so the user can add names and other terms that may be case specific and not have to constantly click Ignore on those terms. Also, if a user adds terms, they remain Case Specific and do not clutter up their current Custom Dictionary for Word. This script does allow the spell checker to use the user's custom dictionary in addition to the case-specific one.

|