I’m relatively new to the AppleScripting world and am trying to script Internet Explorer with an Applescript that will work across all versions of the Mac OS, starting from Mac 8.1. Right off the bat with 8.1, however, I’m hitting a roadblock. With Mac OS 8.5 and 8.6, I can simply say:
tell application "Finder
open location “http://www.apple.com”
tell application “Internet Explorer”
However, with Mac OS 8.1, it:
A) Can’t find Internet Explorer on it’s own (puts up that WHERE IS dialog)
B) If I try to have Applescript find an app with creator id “MSIE”, it doesn’t find it
C) If I tell the finder to “open location”, it doesn’t understand that command.
Something strange about Mac OS 8.1 - - I’ve tried this on 2 iMacs now with 8.1 and got the same results. I’m stuck - - any help is greatly appreciated.
What is the version of your Internet Explorer application? I use 5.1.6 and the following code works fine with it. But it has OpenURL, not goUrl.
tell application "Internet Explorer"
I have IE 5.1.6 as well, and it’s scriptable in that fashion in OS 8.5, 8.6, 9.0, 9.1 and 9.2, but 8.1 is a different story. In 8.1, I can’t do a:
tell application “Internet Explorer”
without getting a “WHERE IS Internet Explorer” dialog. But, if I search for IE by using the Applescript find app with creator id “MSIE” approach (to avoid the Where Is dialog), Mac OS 8.1 doesn’t find IE. Using this technique on OS 8.5 and 8.6 works fine, however.
Something’s definetely different with 8.1, I just don’t know what it is or how to get around it with Applescript. Any advice is greatly appreciated.
“Where is Internet Explorer?” dialog may be coming at the first run of the script. Simply navigate to the Internet Explorer application on the disk and select it. It shouldn’t be asked again at the next runs of the script, of course, if the script were not locked.
I know what you mean, however, in this particular case, I need to write this script to run on other folks computers without forcing them to navigate throughout their hard-drives.
On the Applescript listserve, some kind folks were able to steer me to this script, which launches IE and permits me to extract the HTML source from a page. This works in Mac OS 8.5, 8.6, 9.0, 9.1 and 9.2. I just need something like this that will work in Mac OS 8.1. Unfortunately, Mac OS 8.1 is not finding Internet Explorer via creator type “MSIE” - - - I don’t know why. I’ve got IE 5.1 installed. This is what I need help with. Any advice is greatly appreciated.
set creaType to “MSIE”
tell application “Finder” to open application file id creaType
tell application “Finder” to set appOfMine to (the name of the first process whose creator type is “MSIE”)
tell application appOfMine
set theSource to «event MSIESORC»
display dialog "source = " & theSource
What does it happen when you only run this line of code?
tell application "Finder" to set x to application file id "MSIE"
If this does work, perhaps you could try these statements:
tell app "Finder" to set x to application file id "MSIE" as text
launch application x
run application x
And, about the «event GURLGURL» stuff… Do you have installed the needed osaxen? Just now I can’t remember, but perhaps gurlgurl was introduced after os 8.1? Anyway, you can trying to install 8.5 osaxen or “GURL stuff” osax (1995), which should do the work…
Let us know!
As a thought, is it possible to update the versions of Applescript on these target machines, or is your script destined for customers machines?
If it is possible, and within your scope of doing so, try to update Applescript (or have them do it).
You may have already considered this and decided it is not possible, but I’m throwing it out there anyway.