Way to retrieve creator-type of OS X files?

Robert Brenstein rjb at rz.uni-potsdam.de
Thu Sep 16 11:50:46 EDT 2004


>>
>>IMHO it would be reasonable to support platform-specific features 
>>like these through an external.
>
>Simple enough to script -- I wrote this one to get just the file 
>type, but could easily be extended to include creator code:
>
>
>function fwMacFileType pPath
>   local tSaveDir, tShortFileName, tFileList, tLine, tType
>   --
>   put the directory into tSaveDir
>   set the itemdel to "/"
>   put the last item of pPath into tShortFileName
>   delete last item of pPath
>   set the directory to pPath
>   put the detailed files into tFileList
>   put lineoffset(cr&urlEncode(tShortFileName)&comma, cr&tFileList&comma)
>  into tLine
>   if tLine > 0 then
>     set the itemdel to comma
>     put last item of line tLine of tFileList into tType
>   end if
>   set the directory to tSaveDir
>   return tType
>end fwMacFileType


But it can't be extended to get the finder label, for example.

I am also curious about performance when calling this function 50 
times for a folder with 800 image files.

Robert


More information about the use-livecode mailing list