Want more features on Pastebin? Sign Up, it's FREE!
Guest

Screenshot Location

By: a guest on Dec 24th, 2010  |  syntax: Objective C  |  size: 0.53 KB  |  views: 56  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  2.         NSDictionary *screencaptureDefaults = [defaults persistentDomainForName:@"com.apple.screencapture"];
  3.         NSLog(@"Defaults %@", screencaptureDefaults);
  4.         if (screencaptureDefaults) {
  5.                 NSString *location = [screencaptureDefaults objectForKey:@"location"];
  6.                 if (location && (location = [location stringByExpandingTildeInPath]) && [[NSFileManager defaultManager] fileExistsAtPath:location]) {
  7.                         screenshotLocation = [[NSString stringWithString:location] retain];
  8.                 }
  9.         }
clone this paste RAW Paste Data