• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Save as web archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Save as web archive


  • Subject: Re: Save as web archive
  • From: "koenig.yvan" <email@hidden>
  • Date: Wed, 15 Jan 2014 18:06:03 +0100


Le 15/01/2014 à 17:10, Alex Zavatone <email@hidden> a écrit :


On Jan 15, 2014, at 11:00 AM, koenig.yvan wrote:

set p2d to path to desktop as text

tell application "Safari"
name of document 1
save document 1 in (p2d & result & ".webarchive")
end tell

does the job

If this works, that's odd and sorta scary that just specifying the file name determines the type of file you are saving as.




Why would it be odd ?

The dictionary claims :

save v : Save an object.
save specifier : the object for the command
[as text] : The file type in which to save the data.
[in alias] : The file in which to save the object.

As you may see as and well are described as optional.

I don't know which is the string supposed to define the file type.
When I asked  info for to gave the value it returned ""
When I asked "System Events" it returned missing value.

So I tried with :

tell application "Safari"
save document 1 as "webarchive"
end tell
--> error "You can only specify a file format when you also specify a file in which to save the document." number -1715

The error message make me think to use the optional in parameter with the script :

set p2d to path to desktop as text

tell application "Safari"
name of document 1
save document 1 as "webarchive" in (p2d & result & ".webarchive")
end tell

and got the error :
—> error "The document cannot be saved in the \"webarchive\" format." number -50

As I am pig headed, I thought that if the error message returned by the first attempt may be read as : specify a file in which to save is sufficient.

So I tested an other code and posted :

set p2d to path to desktop as text

tell application "Safari"
name of document 1
save document 1 in (p2d & result & ".webarchive")
end tell

does the job

Now that the technical aspect is answered, I wish to add some words.

When I write: 
does the job

it's because I took time to run the script before posting.


So, the next time, before responding to such a message, 
run the script before writing something like :

If this works, that's odd and sorta scary

Maybe it's due to the fact that English is not my true language, but from my point of view, it was insulting.

Yvan KOENIG (VALLAURIS, France) mercredi 15 janvier 2014 17:57:59



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

This email sent to email@hidden

  • Follow-Ups:
    • Re: Save as web archive
      • From: Alex Zavatone <email@hidden>
References: 
 >Save as web archive (From: Bryan Harris <email@hidden>)
 >Re: Save as web archive (From: Alex Zavatone <email@hidden>)
 >Re: Save as web archive (From: "koenig.yvan" <email@hidden>)
 >Re: Save as web archive (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Save as web archive
  • Next by Date: Re: Save as web archive
  • Previous by thread: Re: Save as web archive
  • Next by thread: Re: Save as web archive
  • Index(es):
    • Date
    • Thread