[jawsscripts] Look up Amazon book, video, or music descriptions and reviews automatically from Windows Explorer

  • From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sun, 6 Sep 2009 19:03:19 -0700

If anyone is interested in trying this script out, I've written a JAWS script 
that does all of this stuff. My main reason was that I wanted to automatically 
look up book descriptions that I could use from my collection of audio books, 
and have the script automatically parse a complex file path such as the 
following
Y:\\Library\Audio Books\Martin, George R. R. - (Fantasy)\Song of Ice and Fire 
(series)\1 - A Game of Thrones (Unabridged CD, 128k)
Then convert this path to the following string 
Martin George R R Song of Ice and Fire A Game of Thrones
And then do an amazon lookup to give me the book description and book reviews 
for this selection. 
Often this returns a list of best matches, which is easily navigated using the 
header navigation commands in JAWS.
I've pasted the more detailed file info below, including the download link. 
This is just a beta script, so please let me know what you think.

/*

Script Details and Instructions



This script will take the currently selected file or folder name, including the 
desired sub-folder names, convert them to a query string 

by running a sudo regular expression on each character to strip out invalid 
characters, then send the query to

http://gutterstar.net/amazon.php

where the service will look up the desired item.

The header navigation commands will then allow you to jump directly to the 
desired info, such as Editor Review for descriptions, or to read public reviews.

This is particularly useful for looking up book descriptions and reviews, but 
the following categories are available for different types of collections...

Books, Classical Music, DVD and Videos, MP3 Downloads for individual tracks, 
and Music for all music.

Here is an example of how it works.

You have a main folder where you keep your library of audio books, the path 
being

Y:\\Library\Audio Books

Within this folder, you have a group of sub folders that indicate the author's 
name, and type of material, such as

Gibson, William - (SciFi,CyberPunk)

In wich, you have more subfolders such as 

Virtual Light (read by Frank Muller)

So, to look up the description and review of this book, you would go to the 
root folder

Y:\\Library\Audio Books

using Windows Explorer.

Then activate the SetBaseFolder script to set this folder as the top level. 

This path is saved to an ini file, so it need only be done once until you wish 
to use another folder instead.

Open the Gibson, William folder, and arrow down to Virtual Light.

Then activate the ParseBook script to look up Virtual Light by William Gibson.

To select different countries and category choices on the fly, simply use the 
SetLocale and SetCategory scripts.



This is how to set up the script...

Open any folder using Windows Explorer, and press Insert+0 to open the Script 
Manager.

Paste the contents of this file into the bottom of the script file.

Go line by line through the constants to set up your defaults.

Then set up hotkeys for each of the scripts below by pressing Control+D on each.

There is additional information at the beginning of each script and function 
below.

*/



Const

; Choose your default search category. Check cs_CategoryOptions for available 
choices.

cs_CategoryDefault = "Books",

cs_CategoryOptions = "Books|Classical|DVD|MP3Downloads|Music",

; Choose your default country. Check cs_LocaleOptions for available choices.

cs_LocaleDefault = "us",

cs_LocaleOptions = "us|uk|ca|de|fr"



Globals

; These variables will store temporary session Category and Locale choices if 
changed on the fly.

String gs_Category,

String gs_locale



Script SetLocale ()

; Use this script to temporarily change your Locale.

; Press Control+D to choose a hotkey for this script.



Script SetCategory ()

; Use this script to temporarily change your Category.

; Press Control+D to choose a hotkey for this script.



Script SetBaseFolder ()

; Use this script to designate the root folder where your top level folders are 
saved.

; This is saved, so it need only be done once.

; For example, set this at the root folder where your Author names lead to 
individual aubio book listings, or where specific bands leed to individual 
album titles, etc.

; This can be set from any folder within Windows Explorer.

; Press Control+D to choose a hotkey for this script.



Script ParseBook ()

; Use this script to look up any listing based on the highlighted folder or 
file name.

; This will include any subfolder names that lead back to the root folder.

; Any information contained within parentheses will automatically be ignored, 
so will punctuation and numeric values. (Only 1 set of parentheses per folder 
or file name.)

; Simply select the folder or file name, and activate this script.

; If the same page is opened to view another item, the same browser window will 
be used to prevent new windows from opening each time.

; Press Control+D to choose a hotkey for this script.



String Function GetBasePath ()

; Function to return the current folder path.

; Press Control+D to register this function, make sure the return type is 
"String"



Void Function RunWithinIE (string url)

; Function to scan for currently running browser instances, then open the new 
request url.

; Press Control+D to register this function, make sure the return type is "Void"



You can download the JSS for this script at

http://gutterstar.net/mbrs/gateway.php?redirect=../cgi-bin/AmazonLookup.zip



Bryan

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts:

  • » [jawsscripts] Look up Amazon book, video, or music descriptions and reviews automatically from Windows Explorer - Bryan Garaventa