Re: Script to save webloc
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