• 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: Using NSSavePanel to export to UTTypeFolder without a file extension.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSSavePanel to export to UTTypeFolder without a file extension.


  • Subject: Re: Using NSSavePanel to export to UTTypeFolder without a file extension.
  • From: Thomas Bunch <email@hidden>
  • Date: Thu, 17 Jan 2013 16:20:11 -0800

Yes, in fact, I do exactly this. It's kind of suboptimal, in that NSSavePanel will first give you a warning:

“Foo.oplx” already exists. Do you want to replace it?” and so on… the user will probably reflexively accept that one.

Then we check and see that you're asking to dump a folder of web stuff, that the folder exists, that its contents don't look like a bucket of HTML and we pop up a second “That seems like a really bad idea, really really blow that away?” sheet.

I think just giving this UTType a file extension is better than that experience, but having NSSavePanel properly maintain the extension (or lack thereof) would be better still. Though I could easily imagine having multiple export types whose Mime type is public.folder.

-Tom

On Jan 17, 2013, at 3:22 PM, Quincey Morris <email@hidden> wrote:

> On Jan 17, 2013, at 14:12 , Thomas Bunch <email@hidden> wrote:
>
>> Launch, take your "document" (very much a stub), File -> Export…, "My Flat Format". Now File -> Export… again but this time pick "My HTML Folder Export". If you have your file extensions visible you'll see at this point that the extension is ".mff". Even so, the typical user will blow away their document at this point without a second thought.
>
> Can't you detect this situation in the save code itself? If you're actually replacing a file with a folder, at least if file extensions were hidden when the save panel closed, you might want to abort the save. If you're replacing a folder with a folder … well, you'd have to decide if it's important that the existing folder has an extension, or doesn't appear to be the kind of folder contents you're replacing it with.
>
> Or, just look at the UTI for what you're replacing. If it's something your app recognizes, you might want to avoid replacing it with a generic folder.
>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Using NSSavePanel to export to UTTypeFolder without a file extension.
      • From: Quincey Morris <email@hidden>
References: 
 >Using NSSavePanel to export to UTTypeFolder without a file extension. (From: Thomas Bunch <email@hidden>)
 >Re: Using NSSavePanel to export to UTTypeFolder without a file extension. (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Changing color in NSColorPanel without message
  • Next by Date: Programmatically Determining the Rendered Size of an NSTextView
  • Previous by thread: Re: Using NSSavePanel to export to UTTypeFolder without a file extension.
  • Next by thread: Re: Using NSSavePanel to export to UTTypeFolder without a file extension.
  • Index(es):
    • Date
    • Thread