• 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: Preference Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preference Files


  • Subject: Re: Preference Files
  • From: Philip Aker <email@hidden>
  • Date: Wed, 16 Sep 2009 16:59:07 -0700

On 2009-09-16, at 16:45:16, Shane Stanley wrote:

the trend looks like it's steering towards POSIX paths

Actually, it looks like it's steering towards URLs. In SL, several APIs for open/save panels have been changed -- methods like setDirectory: have been deprecated in favor of setDirectoryURL.

That's for the API's [1] (and I'm quite happy with those) but we're talking about property list storage format here. The issue is that most unfortunately, the bottom line plist XML categories do not include a <url>…</url> element. Consequently, the storage format must be something else.

[1]

set fpath to missing value
set op to openPanel() of class "NSOpenPanel" of current application
tell op
set allowsMultipleSelection to false
set canChooseDirectories to false
set allowedFileTypes to {"txt"}
set rslt to runModal()
if (rslt is equal to 1) then
set furl to (item 1 of its URLs)
set fpath to (relativePath() of furl) as text
end if
end tell

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

  • Follow-Ups:
    • Re: Preference Files
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Preference Files (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Preference Files
  • Next by Date: cron/Launchd Editor
  • Previous by thread: Re: Preference Files
  • Next by thread: Re: Preference Files
  • Index(es):
    • Date
    • Thread