Ive been trying without success for a day to accomplish this simple task. Usually I would record the action and trim it down to what I need. It wont let me record it. My ultimate goal is to parse and import the text page into filemaker. I plan on running the applescript within filemaker. Im running OS9. Any help would be greatly appreciated.
To summarize. I need to automatically import a web page in netscape that will update on a regular basis into filemaker. My idea was to perodically save the web page as text then import the data, adding only the data that has not changed.
Im fairly new to this, since netscape wont record for me im lost
tell application “Netscape”
OpenURL “http://www.myurl.com/listofstuff.htm”
save reference – the object to save, usually a document or window (
[in file] – the file or alias in which to save the object (filename)
[as type class] – the file type of the document in which to save the data (TEXT)
close reference – the objects to close
end tell
its not complicated, im just not sure what its asking for
It could be one of two things. In your save command you aren’t telling Netscape what to save, or where to save it. Unfortunately, the closest thing I have is Netscape Communicator - which doesn’t appear to have a save command so I can only guess what might work.
--define a path to a file (you would change this for your computer)it shouldn't need to exist at this time.
set saveHere to "Mac HD:Desktop Folder:My List.txt"
tell application "Netscape"
OpenURL "http://www.myurl.com/listofstuff.htm"
save window 1 in saveHere as text--this could be window 0, not entirely sure
--or
save window "Replace with Name of Window" in saveHere as text
close window 1--this could be window 0, am unable to test
--or
close window "Replace with Name of Window"
end tell
I chose communicator cause it had the save as text reference
save reference – the object to save, usually a document or window
[in file] – the file or alias in which to save the object
[as type class] – the file type of the document in which to save the data
is the dictionary reference from communicator.
Any idea why record isnt working in communicator.
Because it most likely isn’t recordable. Some apps just aren’t.
I am using Communicator v 4.7, and don’t see the SAVE command in the dictionary.
Did you try this code? Keep in mind, I am supplying two methods of addressing the window you are working with. You will need to comment out “–” one if you are trying the other.
--define a path to a file (you would change this for your computer)it shouldn't need to exist at this time.
set saveHere to "Mac HD:Desktop Folder:My List.txt"
tell application "Netscape"
OpenURL "http://www.myurl.com/listofstuff.htm"
save window 1 in saveHere as text--this could be window 0, if 1 doesn't work try 0
--or
--save window "Replace with Name of Window" in saveHere as text
close window 1--this could be window 0, am unable to test
--or
--close window "Replace with Name of Window"
end tell