Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: runtime.exec



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 http(s): url, everything is as I expect. If that url is of type 'file:/..' the browsers behave differently, but this is the way the plugin will normally call the browser. 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. Firefox and Mozilla were happy without the Macintosh HD element as was Safari and Camino. But Safari and Camino open the default web page as well as the file. Not a disaster but anoying. I would want all the browsers to behave the same way.
Do you have any idea why IE has such a hard time with a perfectly acceptable path? Or how to tell safari to just open the one page? My results are:


Firefox and Mozilla open the file if they aren't already running or open it in a new window if they are.
IE requires the absolute path, opens with the file if it isn't already running, and replaces the current window with it if it is.
Safari and Camino open the default web page and the file in separate windows if they aren't already running and open the file in a new window if they already are.



Marc Epard wrote:
on 10/4/04 3:37 PM, David Rocks wrote:


Marc Epard wrote:

You could use the osascript command to run a little AppleScript:

osascript -e 'tell application "Safari" to set the URL of (make new document
at the beginning of documents) to "http://www.apple.com";'


Can I do that with a runtime.exec call?


I haven't tried it, but osascript is just a command line tool like any
other, so it should work with runtime.exec.


And will it work with any browser on the mac?


Unfortunately it didn't work when I just tried it with I.E.  This works with
IE:

tell application "Internet Explorer" to OpenURL "http://www.apple.com";

But that didn't work with Safari.  There ought to be an AppleScript command
that works for both, but I don't see it.

-Marc

_______________________________________________
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
References: 
 >Re: runtime.exec (From: Marc Epard <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.