• 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: getting the user's download folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: getting the user's download folder - Veering OFF
      • From: Paul Skinner <email@hidden>
References: 
 >Re: getting the user's download folder (From: Paul Skinner <email@hidden>)
 >Re: getting the user's download folder (From: John Delacour <email@hidden>)

  • Prev by Date: Re: getting the user's download folder
  • Next by Date: Re: getting the user's download folder
  • Previous by thread: Re: getting the user's download folder
  • Next by thread: Re: getting the user's download folder - Veering OFF
  • Index(es):
    • Date
    • Thread