Error type 10 with stay-open applet (and Netscape 4.08)?
Error type 10 with stay-open applet (and Netscape 4.08)?
- Subject: Error type 10 with stay-open applet (and Netscape 4.08)?
- From: Charles Arthur <email@hidden>
- Date: Tue, 20 Mar 2001 23:47:55 +0000
Hi..
I'm enjoying having an Airport base station and a Farallon wireless card
for my Wallstreet. Mostly. I use Larry Rosenstein's Airport Modem Utility
to turn the base station modem on and off.
However AMU has to be restarted after the machine is put to sleep. To get
this done automagically :-) I wrote a stay-open applet, using Jon's
Commands "the ticks", which compares the system time and the ticks, which
are CPU-based, and so not updated during sleep. If the applet finds that
the difference between the ticks and the system time has changed, it
restarts AMU.
The code is: (saved as stay-open)
----
property thedifference : 0 -- difference between the current date and the ticks
(*
A stay-open script to see whether the computer has been put to sleep.
Requires Jon's Commands: the ticks is 60*seconds since computer started up,
measured by the CPU.
Ideally, this should be in the startup items folder.
The key is that the ticks don't run when the computer is in sleep but the
system date does.
*)
on run
set thestart to (current date)
set checksleep to the ticks
set thedifference to thestart - (checksleep / 60)
-- the ticks might start sooner than the date system
--display dialog (thedifference as string)
end run
on idle
set thesleepcheck to ((current date) - ((the ticks) / 60))
if thesleepcheck - thedifference > 10 then -- there is a difference
between
--display dialog "Reconnecting to Airport..." giving up
after 1 -- debugging code
tell application "Finder"
if exists process "Airport Modem Utility" then
tell application "Airport Modem Utility"
quit
end tell
tell application "Airport Modem Utility"
activate
end tell
end if
end tell
set thedifference to ((current date) - ((the ticks) / 60))
--make sure that you don't keep restarting the program
end if
return 60
end idle
------
It works fine with a wide variety of programs (IE, Eudora, Word...).
However, Netsape 4.08, which I need for my online bank, seems to make it
puke. I get a system bomb with error -10. I have had a number of crashes
when running Netscape 4.08 (the browser only), but not other browsers.
Any ideas? Or a quirk of Netscape?
Charles
http://www.ukclimbing.com : 1,000+ British crags, 350+ British climbing walls
- searchable by distance rock type, etc, with 5-day weather forecasts for
every one - plus maps, articles, news, and the New Routes database. There's
even a cool shop attached...