2

I'm developing a simple app for some students. In the app, a student has to select a video which they made in iMovie. I've already set up a NSOpenPanel for this, but I would like it to default to the movies directory, but not the ~/Movies directory, I'm aiming for the movies "directory" underneath the media title in Finder. It is a pretty handy directory, because the students will be able to import videos directly from iMovie, instead of having to export and search for them. (Believe me, they screw this up all the time).

For extra clarity, this is a screenshot of the folder as seen in the open sheet: enter image description here

(My computer is in dutch, hence the name "Films" instead of "Movies")

Community
  • 1
  • 1
rien333
  • 1,154
  • 13
  • 15
  • There is an answer for `Pictures`, but that does not seem to work for `Movies`: http://stackoverflow.com/questions/15815183/how-to-access-media-section-photo-movies-directly-from-nsopenpanel-in-mac-os – Hendrik Feb 19 '15 at 11:13
  • @rien333: Did you manage to figure out how to auto-select an item under the 'Media' section as depicted above in the open panel? – Dalmazio Aug 15 '16 at 23:31
  • No, I don't think I ever managed to unfortunately. – rien333 Aug 16 '16 at 13:52
  • This linked question supposedly works tho? http://stackoverflow.com/questions/15815183/how-to-access-media-section-photo-movies-directly-from-nsopenpanel-in-mac-os?noredirect=1&lq=1 – rien333 Aug 16 '16 at 13:56
  • Unfortunately no. It only opens the `NSOpenPanel` to the location of the Photos library folder. – Dalmazio Aug 18 '16 at 22:46

1 Answers1

0

You can use the URLsForDirectory:inDomains: method of NSFileManager, passing in the appropriate NSSearchPathDirectory enumerator value (in your case NSMoviesDirectory):

NSURL* movieDirectory = [[[NSFileManager defaultManager] URLsForDirectory:NSMoviesDirectory inDomains:NSUserDomainMask] objectAtIndex:0];
sgvd
  • 3,819
  • 18
  • 31
  • I just tested this, it opens the `~/Movies` directory, which isn't the directory I'm looking for, as stated in my question. – rien333 Oct 16 '12 at 14:58
  • Unfortunately, your edit wasn't of much help either, I directly copied your code and it still shows `~/Movies`, which isn't really strange, because, according to the documentation, NSMoviesDirectory is `~/Movies`. – rien333 Oct 16 '12 at 17:46