0

For a given NSOpenPanel or NSSavePanel you can set a directory to show with:

[panel setDirectoryURL:[NSURL fileURLWithPath:@"/SomeFolder"]];

There you can set whatever path you like, but how can you show the Network or Mac devices?

Mac devices view

Network devices view

aone
  • 57
  • 8
  • 1
    I doubt that the Network (Cmd+Shift+K) and Computer (aka devices, Cmd+Shift+C) views of Finder represent any real file system directory to use with NSOpenPanel. Do you have any examples of apps that do that? – battlmonstr May 18 '18 at 13:54
  • No, I do not have any examples. I also thought this might be not possible. – aone May 19 '18 at 08:27
  • It's a bit hacky but you can send Cmd+Shift+K to the panel using `performKeyEquivalent:`. – Willeke May 19 '18 at 10:33
  • That one will unselect the item previously specified with `setDirectoryURL:`, but worth a try. Do you have any sample code? – aone May 21 '18 at 11:00

0 Answers0