Re: Safari Download Folder?
Re: Safari Download Folder?
- Subject: Re: Safari Download Folder?
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 5 Mar 2009 07:16:50 -0500
Dave: There have been three or four messages about this in the thread
already; expanding the ~ is the whole point of all that (do shell
script "echo") stuff.
That is, if you have the string "~/foo" already in an applescript
variable "x", then
do shell script "echo " & x
will expand the tilde, which means that
POSIX file (do shell script "echo " & x) as alias
Will get you the folder as an Applescript alias..
On 3/5/09, Dave <email@hidden> wrote:
> Hi Philip,
>
> On 4 Mar 2009, at 19:01, Philip Aker wrote:
>>
>>
>> Yes, I just noticed that _after_ I sent that post :-)
>>
>> However, I think it's "bundle identifier":
>>
>> set pp to POSIX path of (path to preferences)
>> set bid to bundle identifier of (info for (path to application
>> "Safari"))
>> set sp to pp & bid & ".plist"
>> tell application "System Events"
>> set dldir to get value of property list item "DownloadsPath" of
>> property list file sp
>> end tell
>
>
> This works a treat, thank you so much! One more quick question tho,
> if the downloads folder is on the desktop, the path I get returned is:
>
> "~/Desktop/Downloads"
>
> Is there anyway to expand the "~" so it becomes "/Users/Dave/Desktop/
> Downloads"?
>
> I can always do the expansion myself, but it would be so much nicer
> to have AppleScript do it for me!
>
> Thanks again,
> All the Best
> Dave
>
>
--
Sent from my mobile device
Mark J. Reed <email@hidden>
_______________________________________________
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