At 9:29 am -0400 11/04/01, Morbus Iff wrote:
>This, although usable for technically savvy people, wouldn't work
>for the program's audience. A larger portion of people know where
>programs are located on their hard drive. On a side note, though,
>does asking for the creator string allow me to somehow pass $url to
>the browser?
If the browser location is known it is easy to find the creator string from:
($creator, $type) = MacPer::GetFileInfo($file);
and anyway if necessary, as Bart suggests, the full path to the
browser can be got from:
$file = MacPerl::Choose();
So the creator string could be handed off to
"ICLaunchURL($ICInstance, 0, $url)" to do the business without the
user needing to know anything of the technicalities going on behind
the scenes.
Since ICLaunchURL() works so well (in the context of the server
daemon in which it is being used) I would be inclined to stick with
it.
At 8:51 am -0400 11/04/01, Chris Nandor wrote:
>* If you have the Mac::InternetConfig from the cpan-mac distribution, you
>can [use GetURL($url)], instead of the three lines of code you (Morbus) have:
The point being that the browser could be launched by other means and
then provoked into a request by GetURL()? In the context of Morbus
Iff's program this might prove to be a marginally longer way round
than the method above.
I find incidentally that the version of InternetConfig.pm in MacPerl
5.6.2 does not work with MacPerl 5.2.1a1. Is that to be expected I
wonder?
At 8:51 am -0400 11/04/01, Chris Nandor wrote:
>Alan's script will launch the application, but you still need to talk to
>it. Some options (all assumed $app (four-char signature) or $path (full
>path to application), and $url, are defined):
Yes, that's true. I think all AE methods boil down to an
AEBuildAppleEvent of the kind:
AEBuildAppleEvent ( 'GURL', 'GURL', 'sign', "$creator", 0, 0,
"'----':TEXT(\@)", "$url")
Preliminary experiments in the context of the server (which is the
basic structure of Morbus Iff's program) show variable success. It
works best with MSIE, fails occasionally with Netscape and fails
totally with iCAB. The reasons for this are not at all clear. It
makes a difference whether a browser window is open at the time and
(surprisingly) if MacPerl's console window is active.
My very strong feeling is to avoid this approach altogether. It's
messy, iffy, and un-necessary. ICLaunchURL() works fine, and it can
allow just as much 'user flexibility' as anything else really.
HTH,
Alan