[jawsscripts] Auto updating scripts solution found

  • From: "John Martyn" <johnrobertmartyn@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 7 Feb 2012 13:18:13 -0800

Try this out, you will find it useful in doing an auto update. It does
require that you use the exact length of program version IE 1.3.0 and
current version 1.3.3 when you define things in both the script file. They
must be the same length for this to work.
An html file must be written like this:
<html>
<head>
<title>1.3.3</title>
</head>
</html>

Then in the script file you can call this in the background without showing
anything unless there is an update.
function updateScript()
var
object o,
handle theIE,
string currentVersion,
string programVersion,
int trigger,
int safety
let programVersion = "1.3.0"
let programVersion = StringReplaceSubstrings (programVersion, ".", "")
let o = CreateObject ("internetexplorer.application")
o.visible="false"
o.navigate("www.blindtunes.net/currentVersion.htm")
while trigger != 1
let safety = safety+1
Delay (10, 1)
let theIE = o.hWND
if theIE != 0 then
let trigger = 1
endif
if safety == 10 then
let trigger = 1
endif
endwhile
let currentVersion = o.locationname
let currentVersion = StringReplaceSubstrings (currentVersion, ".", "")
let currentVersion = StringReplaceSubstrings (currentVersion, ".", "")
if StringToInt (programVersion ) < StringToInt (currentVersion ) then
Say("Your program is out of date",3)
o.visible="true"
SetFocus (theIE)
o.navigate("www.blindtunes.net/BlindTunes"+o.locationname+"Setup.exe")
endif
EndFunction

I have tested this and it works and no confusing approaches need to be made.
John Martyn

__________�

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

Other related posts:

  • » [jawsscripts] Auto updating scripts solution found - John Martyn