[Date Prev][Date Next][Thread Prev][Thread Next]
[Search]
[Date Index]
[Thread Index]
Re: [MacPerl] Re:FindFolder puzzler
I'm sending this again because it doesn't seem to have appeared on the list (and I sent it before Chris posted the list of folder types)
rather unsurprisingly by passing the file type to FileFind() I get the path (which is what I'm doing obliquely with those LongFolderType() chappies), and to be honest was what was causing me problems in the first place - I have no problems using the four character foldertypes because I know what they are and how to use them, rather than trying to figure out if I'm dealing with a constant, string or function, which was the case with NamesLikeThis().
>And I think it's no longer the paths to *all* the standard folders, which
>now include the Applications and Documents folders (Documents is more
>important in Mac OS 9 than it has been since OpenDoc bit the dust), the
>Scripting Additions folder (the one in the System Folder, not the obsolete
>one in Extensions) and several others.
inshort get the foldertype code if this is what you want to do
see the revised editon of the script below
__BEGIN__
#! perl -w
use diagnostics-verbose;
use strict;
#-=-=-=-=-=Declare Includes-=-=-=-=-=-=-=-=-=-=-=
use Mac::Files;
use File::Find;
#-=-=-=-=-=Declare Variables-=-=-=-=-=-=-=-=-=-=
my ($path,$folder,$filetype,@StdFolderTypes);
#-=-=-=-=-=Script Body-=-=-=-=-=-=-=-=-=-=-=-=-=
#loop method
@StdFolderTypes=qw(amnu
shdf
ctrl
strt
desk
macs
extn
temp
font
trsh
pref
);
foreach $filetype (@StdFolderTypes) {
$path=FindFolder(kOnSystemDisk(),$filetype);
print "file type: $filetype \tpath: $path\n";
}
__END__