When I present a NSOpenPanel
to the user I'd like it to have a file that the user opened earlier already selected from the start.
There is [NSSavePanel setDirectoryURL:(NSURL*)
to preselect a directory, but I can't find an API to select the initial file.
There use to be:
- (NSInteger)runModalForDirectory:(NSString *)path file:(NSString *)filename
This call is exactly what I need. The docs say:
Specifies a particular file in path that is selected when the Save panel is presented to a user. When nil, no file is initially selected.
But unfortunately that method was deprecated in 10.6.