Safari: getting name of document
Safari: getting name of document
- Subject: Safari: getting name of document
- From: Oz Springs <email@hidden>
- Date: Sat, 30 Aug 2003 13:01:53 +0100
A few months ago someone on this list gave me the script for getting the url of the front document of Safari.
I have since figured out how to get the text of the front document but what I really wanted was the name of the page, but with not much success. My script is currently:
tell application "Safari"
set theURL to URL of the front document
[and either set theName to name of the window (this is wrong!!)
or] set theName to name of the front document (this is wrong too!!)
set theText to text of the front document
tell application "FileMaker Developer"
set field "gURL" to theURL
set field "gName of Source" to theName (at this point if it gets this far Script Editor tells me theName with either script line above, is not defined)
set field "gText of Source" to theText
end tell
end tell
There appears to be three places in the Safari dictionary which lists "name" as a property and when I try to compile it in Script Debugger (which is the most amazingly helpful app for AppleScript I have ever tried), it tells me that "name" refers to "Safari".
Opening the Safari dictionary in Script Debugger and using its Explorer I get the following:
Properties of first document
class = document
name = missing value
Properties of window "Index of /archives"...etc = window id 2823
class = window
name = "Index of/archives/applescript-users/2003/Aug/01"
Properties of document
class = application
name = "Safari"
So what I would like to have is the window name. How do I get this?
Thanks for any help
Oz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.