title: NSOpenPanel URL to string
body: <p>I used codes below to open a file</p>
  
  <pre><code>    NSOpenPanel * panel = [NSOpenPanel openPanel];
              [panel setCanSelectHiddenExtension:YES];
              [panel setRequiredFileType:@"scpt"];
              [panel setAllowsOtherFileTypes:NO];
  
              [panel
               beginSheetForDirectory:nil
               file:@"Script"
               modalForWindow:[self window]
               modalDelegate:self
               didEndSelector:@selector (openFileDidEnd:returnCode:contextInfo:)
               contextInfo:nil];
  
  -(void)openFileDidEnd:(NSSavePanel*)panel returnCode:(int)returnCode contextInfo:(void*)contextInfo
  {
  
  
  if(returnCode == NSOKButton)
  {
  
      NSString *s=[[panel URL] absoluteString];
      [NSThread detachNewThreadSelector:@selector(setFileString:) toTarget:self withObject:s ];
  
  }
  };
  </code></pre>
  
  <p>s value is 'file://home/Users/myName/Desktop/1.scpt'</p>
  
  <p>if I call</p>
  
  <pre><code>bool b=[[NSFileManager defaultManager] fileExistsAtPath:@"file://home/Users/myName/Desktop/1.scpt"];
  </code></pre>
  
  <p>check if the file with path s exists, it always returns 0</p>
  
  <p>but if I checked in Finder, I found its path is '/Users/myName/Desktop/1.scpt'</p>
  
  <pre><code>bool b=[[NSFileManager defaultManager] fileExistsAtPath:@"/Users/myName/Desktop/1.scpt"];
  </code></pre>
  
  <p>will return YES!</p>
  
  <p>How can I get the correct string path from url of NSOpenPanel ?</p>
  
  <p>Welcome any comment</p>