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 11:15:17 +0100
- Mac-eudora-version: 6.0a14
At 3:11 am +0100 11/4/03, I wrote:
Here's another way to do it. It would probably be half the length
if I'd got my brain round 'pack'.
Lucky find this morning. O'Reilly's "Mastering Algorithms with Perl"
gave me the answer to my pack problem in two minutes.
The previous script would break, in any case, with "Kylie's Disk"
etc., so it's necessary to write the pathname to a file and read the
file. So here's something that ought to work in all cases:
getDownloadFolder()
--
on getDownloadFolder()
read POSIX file (do shell script "perl -e '
$f = q~/tmp/tmp~; print $f ;
$_ = `defaults read com.apple.internetconfig`; s~\\s~~g ;
s~(.+adFo[^<]+<)(..)([^>]+)~$3~ ;
$vol = substr $_, 0, 2 * hex $2;
$start = qq~$vol\\63a~ ;
/(..)($start.+)/ and $s = substr $2, 0, 2 * hex $1 ;
open F, qq~>$f~ ; print F pack q~H*~, $s ; '")
end getDownloadFolder
-- JD
_______________________________________________
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.