[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] desktop files' path



>Too much work, and not predictable if you should ever want to move the
>script to another machine. Use something like this, instead:
>$hostname = `pwd`; @path = split(/:/, $hostname); $hostname = $path[0];
>$desktop = "$hostname:Desktop Folder";

Unfortunately, all this does is get you the desktop folder on the volume
the script is on, which may or may not be the same desktop folder as
another file on the desktop. (And assuming it's called 'Desktop Folder',
which isn't always true either.)

If you've got a file that you know is on the desktop, you'll have to
iterate over the volumes, passing each vRefNum to FindFolder in turn, then
checking the resulting directory. Of course, you could still get the wrong
file. It's probably best to not put things on the desktop, or to use the
paths in @ARGV or returned by one of the StandardFile functions.

Brian



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch