• 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: Script to save webloc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to save webloc


  • Subject: Re: Script to save webloc
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 08 Jan 2009 13:24:48 -0800
  • Thread-topic: Script to save webloc

Both of these work OMM:

set dest to "MacOSX:Users:edstockly:untitled folder"
set dest to alias "MacOSX:Users:edstockly:untitled folder:"
tell application "Safari"
    set curl to URL of document 1
    set dnam to name of document 1
end tell
tell application "Finder"
    make new internet location file at dest to curl with properties
{name:dnam}
end tell

>>> I have also added "as string"

When needed, it's better to use as text, or as unicode text

>>>Applescript paths are getting in my way.

I always use alias for paths. They're nearly bulletproof. If the file or
folder exists, I get an alias to it and if I need a posix path I start with
alias and let appleScript coerce it to posix path:

  set dest to alias "MacOSX:Users:edstockly:untitled folder:"
  set dest to POSIX path of dest

In this case Safari wants an alias or an HFS file specifier.

HTH,

ES

On 01/08/09 12:54 PM, "email@hidden"  wrote:

>
> I have been trying every which way I can.  Applescript paths are
> getting in my way.  I want to save the file to ~/somefolder which is
> in my home folder, but nothing I try works:
>
> set dest to "/Users/me/somefolder"
> set dest to "/Users/me/somefolder/"
> set dest to ":Users:me:somefolder"
> set dest to ":Users:me:somefolder:"
> set dest to "Volumes:drive:Users:me:somefolder"
> set dest to ":Volumes:drive:Users:me:somefolder"
> set dest to "drive:Users:me:somefolder"
> set dest to ":drive:Users:me:somefolder"
>
> None of those seem to work, I have also added "as string" to the end
> and still get an error.  Any help would be appreciated.
> --
> Scott

 _______________________________________________
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: Script to save webloc
      • From: "Stockly, Ed" <email@hidden>
  • Prev by Date: Re: Script to save webloc
  • Next by Date: Re: Script to save webloc
  • Previous by thread: Re: Script to save webloc
  • Next by thread: Re: Script to save webloc
  • Index(es):
    • Date
    • Thread