David Rocks <email@hidden> wrote:
> The script statement
>> tell application "Safari" to open location "file:/Macintosh
>>HD/Users/rocks/home.html"
>
>works with all the browsers but with different results. If I point to a
D'oh! I just realized something about that pathname: it's in Carbon form.
That is, it starts with "Macintosh HD".
When I drop local HTML files onto Safari, I see the Unix-style pathname
form, not the Carbon form. For example:
file:///Volumes/BigDisk/stuff/index.html
file:///Users/me/Browers/start.html
I'm not saying the Carbon form can't work, but it does strike me as odd
that one is even able to obtain it using Java, since the boot-drive's
volume-name is not part of Java's pathname syntax.
Or is the plugin receiving the Carbon form, and that's all it has to work with?
I also noticed that when I drop a local HTML file on MSIE, it shows the URL
with localhost as host-name:
file://localhost/Volumes/BigDisk/stuff/index.html
>IE couldn't find the file unless
>I included the 'Macintosh HD' element in the path. I don't know how I am
>going to handle that in the config file.
I tried the following in Terminal, and it worked:
osascript -e 'tell application "Internet Explorer"' \
-e 'openURL "file:///Volumes/BigDisk/stuff/index.html"' \
-e 'end tell'
This was on 10.3.5 with MSIE 5.2.3 (5815.1), though I have no reason to
suspect it won't work on a reasonable backwards range of MSIE versions.
The 'openURL' verb did NOT work on Safari at all, but the 'open location'
verb did, using exactly the same URL form (i.e.
file:///Unix-style-pathname). And 'open location' also worked in MSIE,
using the Unix-style pathname.
BTW, I only used the tell/end form to not have long lines in this email.
The single-line form works equally well with both browsers I tested.
Based on the above, I suspect that at least part of the problem is the form
of the pathname in the URL. Try using Unix-style pathnames, not
Carbon-style pathnames. And use "file:///" instead of "file:/".
If all you get is a Carbon-style pathname string, then you'll have to
convert it. There are a couple ways of doing conversion, but if you don't
need the info I won't elaborate now. Ask again if that's what you need.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden