Re: getting the user's download folder
Re: getting the user's download folder
- Subject: Re: getting the user's download folder
- From: John Delacour <email@hidden>
- Date: Fri, 11 Apr 2003 03:11:29 +0100
- Mac-eudora-version: 6.0a14
At 9:00 pm -0400 10/4/03, Paul Skinner wrote:
On Thursday, April 10, 2003, at 05:57 PM, John Delacour politely
wrote me off-list:
Try that with a disk named "Chrysanthemum" :-)
Grrrrr... Me and my ten-fingered bias for decimal!
I knew that was too easy. Here's the next duck for the shooting
gallery. Anyone with their Download folder on a remote Windows
server? : )
Glad you like my manners :-)
Here's another way to do it. It would probably be half the length if
I'd got my brain round 'pack'.
UsersDownloadFolder()
on UsersDownloadFolder()
do shell script "perl -e '
$file = q~com.apple.internetconfig~ ;
$_ = `defaults read $file | grep -A 1 DownloadFolder`;
s~ ~~g;
$_ =~ /<(.+)>/ and $_ = $1;
$n = 2 * hex substr $_, 0,2;
$diskname = (substr $_, 2, $n);
$start = qq~$diskname\\63a~;
/(..)($start.+)/i and
$pathlength = hex $1
and $_ = $2 ;
for (split //) {
shift; $string .= $_;
length $string == 2 and
$s .= chr hex $string and $string = q~~;
}
print substr $s, 0, $pathlength ;'"
end UsersDownloadFolder
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.