• 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/Smile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting the user's download folder/Smile


  • Subject: Re: getting the user's download folder/Smile
  • From: Philippe GRUCHET <email@hidden>
  • Date: Fri, 11 Apr 2003 03:05:46 +0200

Oops! I'm glad you caught that. This is much more robust. I think this should work consistently.
It works so consistently here that Script Editor 2 crashes every time when I run it :-)

Confirmed here with SE2, and SE 1.9 too.

But, Paul's script woks perfectly in Smile 2.5.2: returns the right path on every machine.


Kind regards,
Philippe/SVM Mac
http://svmmac.vnunet.fr

-------------------------------------

Paul Skinner's script:

on UsersDownloadFolder()
set AppleScript's text item delimiters to "<"
set {iConfigData, AppleScript's text item delimiters} to {text item 2 of (do shell script "defaults read com.apple.internetconfig | grep -A 1 DownloadFolder"), ">"}
set {iConfigData, AppleScript's text item delimiters} to {text item 1 of iConfigData, " "}
set {iConfigData, AppleScript's text item delimiters} to {text items of iConfigData, ""}
set iConfigData to iConfigData as text
set hexDiskName to (text 3 thru (((text 1 thru 2 of iConfigData) as number) * 2) of iConfigData)
set AppleScript's text item delimiters to hexDiskName
set {iConfigData, AppleScript's text item delimiters} to {item 4 of (text items of iConfigData), "00"}
set {iConfigData, AppleScript's text item delimiters} to {text item 1 of iConfigData, ""}
set DownloadFolderpath to (do shell script "echo " & hexDiskName & iConfigData & " | perl -ple's/([0-9a-fA-F]{2})/chr(hex($1))/ge' ") & ":"
set {text:plainText} to (text of DownloadFolderpath) as text
return plainText
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.
  • Prev by Date: Re: Understanding System Events...
  • Next by Date: Re: getting the user's download folder
  • Previous by thread: Re: getting the user's download folder
  • Next by thread: OSAX/Scripting Addition (OS 9) plea
  • Index(es):
    • Date
    • Thread