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: How to save the Safari front window contents by script






[1] Both code have its own trouble while executed here. But they lead me to search how to get the document name. I remembered that I found it easely with Netscape... and fall into the code to save the document source (what I wanted) without dialog.


Yvan code:
Error in System Events:
NSReceiverEvaluationScriptError: 4

I get the save as sheet dialog, AppleScript Text Editor open, behind.

Malcom code: does not return the title (document.title returns an empty string)



Hello Emile

I'm a bit surprised because on my machine it works flawlessly.

In my first attemps, I forgot the
tell application "Safari" to activate
and so, as I was executing from the Script Editor, Safari was not "at front".


With the added instruction, Safari is put at front and so the script correctly saves the site contents.

Yvan KOENIG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >How to save the Safari front window contents by script (From: 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.