On 3/8/08 at 12:22 AM, Jim DeVona <[EMAIL PROTECTED]> spake thusly:

 --Also, sometimes the title is blank even when it the document
 has a title

 tell application "Safari"
        activate
        set theURL to URL of document 1
        set theName to do JavaScript "document.title" in document 1

Neat script. I use the following method to get the page title for my
"Bookmark in Yojimbo" scripts, and it seems to work quite reliably:

set theName to the name of document 1

If the web page is properly coded the existing script should work as expected. If it's a malformed page then all bets are off. There's also been a few changes in Safari since I posted the original script and if you find you can use Applescript to replace the javascript, go for it.

J
--
The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. It is its natural manure. -Thomas Jefferson

--
------------------------------------------------------------------
This message is sent to you because you are subscribed to
 the mailing list <yojimbo-talk@barebones.com>.
To unsubscribe, send mail to: <[EMAIL PROTECTED]>
List archives:  <http://www.listsearch.com/yojimbotalk.lasso>
Have a feature request, or not sure if the software's working
correctly? Please send mail to: <[EMAIL PROTECTED]>

Reply via email to