Re: info for file help...
Re: info for file help...
- Subject: Re: info for file help...
- From: Nigel Garvey <email@hidden>
- Date: Thu, 14 Dec 2000 11:23:39 +0000
"Robert Seckendorf" wrote on Wed, 13 Dec 2000 16:08:32 -0800:
>
Does anyone know how to capture all the properties of the results variable
>
(record) so they can be parsed into individual variables. I have tried to
>
copy the value of results into a new variable, but I can't gain access to
>
more than one value in the record without getting weird errors.
What sort of errors are you getting? The labels in the record will vary
according to whether it refers to a file, a folder, an alias to a file,
or an alias to a folder. The following works in 8.6, though there may be
other properties in earlier or later Mac OS-es. (Watch out for the two
very long 'set' lines.)
set myAlias to choose file
-- set myAlias to choose folder
set theInfo to info for myAlias
set {fName, fcDate, fmDate, fiPos, fVisible, fSize, fFolder, fAlias} to
{name, creation date, modification date, icon position, visible, size,
folder, alias} of theInfo
if fFolder then -- myAlias is a folder
set fFWindow to folder window
else -- myAlias is a file or an alias file
set {fLocked, fCreator, fType, fsVersion, flVersion} to {locked, file
creator, file type, short version, long version} of theInfo
end if
try
set fDefApp to default application of theInfo
on error
-- myAlias is a folder or an alias to one
end try
NG