Another newbie Mac Question...

Richard Gaskin ambassador at fourthworld.com
Mon Jan 5 18:01:02 EST 2004


Chipp Walters wrote:

> 
> Thanks for the PNGf note. It works!
> 
> see below...
> 
>> Behalf Of Richard
>> Gaskin
>> Chipp Walters wrote:
>> 
>>> In the docs, it says with filter works. Is this a mistake?
>> 
>> Where?  The entry for "answer file" discusses using the 'type"
>> form for Mac OS.
> 
>> From the docs:
> 
> Filtering for Mac OS:  You can use either with filter or of type. With
> either form, the types parameter consists of one or more 4-character file
> types, concatenated. For example, to display text and PICT-format files but
> no others, use a types parameter of ?TEXTPICT?. To display applications
> only, use a types parameter of ?APPL?.

Where is that passage located?  I may be tired, but I'm not seing it in the
Transcript Dictionary entry for "answer file".

Trying this on OS X 10.2.8:

  answer file "Seleect a PNG file:" with filter "*.png"

...does not let me select a file whose name ends in ".png".

...
>> With OS X Apple no longer requires file type assignments, posing a problem
>> for us.  I'm not sure Apple has yet decided what to do about either file
>> types or creator codes for the long term, so I'm not familiar with a
>> workaround for selecting files that rely only on file name extension on OS
>> X.
>> 
>> Anyone come across a current Apple tech note on this?  Last I heard Apple
>> required developers to write a custom filterProc for Nav Services (ugh!).
> 
> It does appear that using the answer file with type "PNGf" works for .PNG
> files

Here (OS X 10.2.8) it only works for files which have the appropriate type
assigned as Finder metadata.  If I get one from the Internet so no Finder
data is attached it is not selectable with either syntax, filter or type.

So the conundrum remains:  How do we expect Rev the write a custom
filterProc which will handle all possible Finder type code/file name
extension combinations?

I suppose the next question would be:  If Apple expects Rev to pull this
off, couldn't we expect Apple to just provide such a mechanism themselves?

In the info.plist documentation at
<http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/
Concepts/PListKeys.html#//apple_ref/doc/uid/20001431/TPXREF107>, it seems
the info the OS would need is already spec'd:  plists can have a
CFBundleTypeOSTypes entry for the 4-characxter type code in addition to the
CFBundleTypeExtensions entry for the file name extension.

So all the parts needed for the OS to pull this off seem to be in place, yet
Apple tells developers to write custom filter procs -- or so it was last
time I looked into it; I'd love to find that it's been addressed, and to see
Tuv employ such an API if one exists.

In the meantime, filtering for files which do not have an assigned file type
code does not appear possible in Rev, at least in OS X 10.2.8.  It would be
useful to know if Pnther users can do this, maybe Apple's alredy addressed
it.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge: Publish any database on any Web site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list