• 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: Safari Download Folder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safari Download Folder?


  • Subject: Re: Safari Download Folder?
  • From: Philip Aker <email@hidden>
  • Date: Thu, 5 Mar 2009 07:59:22 -0800

On 2009-03-05, at 03:50:01, Dave wrote:

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!

In addition to Mark Reed's solution, there is another EZ shell script way:

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
do shell script "cd " & dldir & ";pwd"

Meaning that, if it would be useful, you could also get a listing of any specific types of files you are interested in at the same time:

paragraphs of (do shell script "cd " & dldir & ";pwd;ls *.dmg *.zip *.gz *.tgz;")


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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

References: 
 >Safari Download Folder? (From: Dave <email@hidden>)
 >Re: Safari Download Folder? (From: "Mark J. Reed" <email@hidden>)
 >Re: Safari Download Folder? (From: Luther Fuller <email@hidden>)
 >Re: Safari Download Folder? (From: "Mark J. Reed" <email@hidden>)
 >Re: Safari Download Folder? (From: Philip Aker <email@hidden>)
 >Re: Safari Download Folder? (From: "Mark J. Reed" <email@hidden>)
 >Re: Safari Download Folder? (From: Philip Aker <email@hidden>)
 >Re: Safari Download Folder? (From: Dave <email@hidden>)

  • Prev by Date: Re: Safari Download Folder?
  • Next by Date: Re: Safari Download Folder?
  • Previous by thread: Re: Safari Download Folder?
  • Next by thread: Re: Safari Download Folder?
  • Index(es):
    • Date
    • Thread