Re: Finding default browser with AS
Re: Finding default browser with AS
- Subject: Re: Finding default browser with AS
- From: Jan Pieter Kunst <email@hidden>
- Date: Mon, 30 Apr 2001 17:13:10 +0200
John W Baxter (email@hidden) schreef op 30-04-2001 16:23 :
>
At 12:55 +0200 4/30/01, Jan Pieter Kunst wrote:
>
> But (wild idea) maybe I could do this only once, and save the browser
>
> signature in some kind of 'preference' for the script? By saving a text file
>
> with the signature somewhere, maybe, or is it somehow possible for a script
>
> to modify itself permanently? I.e., something like, on first run, find
>
> browser signature, save self with information about default browser, use
>
> that browser for subsequent runs?
>
>
You've received an answer as to how to this, but--do you want to do this?
>
>
People do change their preferences from time to time. They will likely
>
"forgive" you if they make a change while the script is running and you
>
don't notice...they are likely to be disgruntled if they change the default
>
browser and the script hasn't noticed by tomorrow. If "they" means
>
"you...Jan Pieter" then you could simply recompile the script to recover.
>
A more general audience might well contain people who would have trouble
>
with that task.
I see what you mean. How about this for a solution (pseudo-code):
if property gBrowserCreator = "" then
open location "
http://..."
set gBrowsercreator to the app that opened the URL
if gBrowserCreator = a browser then
check if gBrowserCreator is running
if no, open location "
http://..."
if (the app that opened that URL is different from gBrowserCreator) then
change gBrowserCreator to the app that opened the URL
if yes, check if it's already at "
http://..."
if no, open location "
http://..."
if (the app that opened that URL is
different from gBrowserCreator) then
change gBrowserCreator to the app that opened the URL
if yes, don't reload
The point is that I don't want to reload the location if the browser is
there already. Otherwise I could just do 'open location' everytime and don't
bother what browser is opening it. But if I want to do this check then I
have to know what the default browser is and at what location it is.
It seems to me that with a check after each 'open location' I should be able
to keep up with the user preferences.
Jan Pieter.-