Re: Finding default browser with AS
Re: Finding default browser with AS
- Subject: Re: Finding default browser with AS
- From: David Blache <email@hidden>
- Date: Mon, 30 Apr 2001 08:48:00 -0500
on 4/30/01 6:51 AM, Jan Pieter Kunst (email@hidden) wrote:
>
> property gBrowserCreator : ""
>
>
>
> on run
>
> if gBrowserCreator = "" then my ResolveBrowser()
>
> end run
>
>
>
> on ResolveBrowser()
>
> tell application "File Exchange"
>
> set browser to creator type of (extension mapping "html")
>
> quit
>
> end tell
>
> return browser
>
> end ResolveBrowser
>
>
Yes, but this doesn't keep the value of 'browser' after the script quits,
>
unless I'm mistaken? Or am I missing a step where the script saves itself
>
with "property gBrowserCreator : browser"?
Oops. My bad. Geeez, it must be Monday. ;)
I omitted two crucial steps.
#1: The script did not save the browser creator to the gBrowserCreator
property.
#2: The script won't save properties on exit. If you return true as the
return value for the quit handler, your properties will be saved.
Here's the complete, working script:
property gBrowserCreator : ""
on run
if gBrowserCreator = "" then set gBrowserCreator to ResolveBrowser()
display dialog "The browser creator code is: " & gBrowserCreator
end run
on quit
return true
end quit
on ResolveBrowser()
tell application "File Exchange"
set browser to creator type of (extension mapping "html")
quit
end tell
return browser
end ResolveBrowser
Sorry for the confusion...
JR