Skip to main content
Known Participant
June 27, 2008
Question

How get the filepath of the current user's desktop in Leopard?

  • June 27, 2008
  • 2 replies
  • 702 views
Want to set the current user's desktop foler be default directory, I've tried "~/Desktop" string, but it doesn't work.

Thanks.

hanyang
This topic has been closed for replies.

2 replies

jdyyzAuthor
Known Participant
June 30, 2008
Thanks Jeshua Lacock!

I've get it!

hanyang
3DTOPO
Inspiring
June 30, 2008
You may have to write a small Cocoa application that returns the full path.

This Cocoa call will do what you need:

NSString *fullPath;

fullPath = [@"~/Desktop" stringByExpandingTildeInPath];