View Full Version : finding the desktop path on win / mac os

01 January 2008, 07:09 PM
hello !

i am searching a maya command that stores finds the desktop path either on macs or on pcs...

i checked the docs, but could not find the *quick answer* ...

thanks for any input.

01 January 2008, 09:22 AM
Small not perfect Workaround...

// Windows
string $DesktopPath = `getenv "HOMEPATH"` + "/Desktop";

Don't have MacOS to test it there

01 January 2008, 04:47 PM
i think HOMEPATH might be a windows specific env, bc it doesn't return anything on osx. however, on osx and linux you can use ~ as a shortcut for the home directory. for example:

system( "ls ~/Desktop/")


01 January 2008, 06:57 PM
thanks so far, guys !

for macs:

global string $desktopPath;
$homeString =`getenv "HOME"`;
$desktopPath = ($homeString + "/Desktop/");

CGTalk Moderation
01 January 2008, 06:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.