answer file of type ... ?

J. Landman Gay jacque at hyperactivesw.com
Sat Mar 17 13:25:00 EDT 2007


kee nethery wrote:

> I found a format that works on Mac OS X.
> 
> answer file "select the .ics file" with type "iCal file|ics"
> 
> that is "iCal file" then a pipe "|" then the file suffix without the dot 
> "ics"
> 
> "iCal file" can be seen as the "Kind" of file in the Mac OS X finder 
> window with the files in a list. The file suffix is visible as part of 
> the file name. The example I pulled this from had a file type as the 
> third element "iCal file|ics|RCSK" where "RCSK" would be the Finder File 
> Type but this appears to be optional.
> 
> This is not an example displayed in the "answer file command" docs. 

It has its own entry listed under "answer file with type". The entry is 
also listed as a "see also" under the older "answer file" command entry. 
The new format was introduced in Rev 2.6 and will work cross-platform. 
If  you use the older "answer file" syntax, you need to branch the 
"answer" command depending on platform. The newer entry works with the 
same command everywhere.

An example of the newer syntax is:

answer files "Select images:" with type "JPEG Images|jpg|JPEG"

The types you use should be a return-delimited list of values of the 
form "tag|extensions|filetypes". This lets you list Windows extensions 
in the second piped item and Mac file types in the last one. If you omit 
the last string (which you say works okay) then I'm guessing the command 
may only look at file name extensions and may not include any files of 
the correct type that don't have extensions in their names. I haven't 
tested that though.

Regarding discovery of Mac file types, another way to find out what 
these are is to get the "detailed files" of a folder that contains a 
file whose type you want to know. (See the "files" entry in the docs.) 
The last item of each line in the list will be the Mac creator and type 
codes, provided you are on a Mac when you do it.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list