Perhaps I'm not understanding properly, but are you suggesting that I use NSOpenPanel to save files?
That doesn't make any sense... On Thu, Apr 30, 2009 at 3:14 PM, Tom Hohensee <tom...@mac.com> wrote: > HenriettaYou have to use NSFileManager displaynameAtPath: in conjuction > with NSOpenPanel. Here is some sample code I hope helps > > //Run the open panel > [panel beginSheetForDirectory:nil file:nil types:fileTypesArray > modalForWindow:[self window] modalDelegate:self didEndSelector:@selector( > openPanelDidEnd:returnCode:contextInfo:)contextInfo:NULL]; > > -(void)openPanelDidEnd:(NSOpenPanel*)sheet > returnCode:(int)returnCode > contextInfo:(void*)contextInfo { > //Did they choose open > if (returnCode == NSOKButton) > { > NSFileManager *fileManager = [NSFileManager defaultManager]; > NSString *displayNameAtPath = [fileManager displayNameAtPath:[sheet > filename]]; > ......... > .... > .. > . > } > } > > Tom > > > On Apr 30, 2009, at 3:28 PM, Henrietta Read wrote: > > Question, > > I'm passing a file name such as 'MyTextFile.txt' to NSSavePanel > runModalForDirectory. > > When the panel appears the entire string is selected, but I would rather > that just > 'MyTextFile' is selected. Is it possible to set the selection to exclude > the > file > extension? > > > Thank you. > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/tomhoh%40mac.com > > This email sent to tom...@mac.com > > > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com