Re: Path to desktop
Re: Path to desktop
- Subject: Re: Path to desktop
- From: "Jim Turner" <email@hidden>
- Date: Mon, 9 Jul 2007 11:50:21 -0500
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Desktop"];
That should do what you need.
On 7/9/07, Micha Fuhrmann <email@hidden> wrote:
Ok,
I'm bit tired today, sorry for my laziness, I just need the full path
of the User's desktop, how can I get it in 3 simple lines of code, I
would hate to resort to an Apple Script that gives me what I want in
6 words (set thePath to path to desktop)! Here's what I've played with:
NSArray* paths = NSSearchPathForDirectoriesInDomains
( NSDesktopDirectory, NSUserDomainMask, NO );
NSString *theDesktopPath = [paths objectAtIndex:0];
Do I really need to reconstruct the full path with
stringByAppendingPathComponent ?
There's got to be something simple!!!
Any help very much appreciated.
Micha
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Jim
http://nukethemfromorbit.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden