ask file with filter/type - how to read the selected type ?

J. Landman Gay jacque at
Tue Jun 10 12:35:53 EDT 2008

viktoras didziulis wrote:
> Jacqueline, Thanks for the suggestion,
> still 'the result' after execution is empty. It would probably contain 
> something if path selection failed. The other 'result' (path stored in 
> 'it') does not always contain an extension. If user types it in, or 
> chooses from a list of existing file names, then it is there. But 
> otherwise if user provides file name without an extension, script has to 
> check what was the file type selected, appends correct extension and 
> directs output to a necessary processing handler.

I misread your post, I didn't notice you were using "filter". But I just 
did a test using "with type" and it works.

on mouseUp
   ask file "Export picture as:" with type "JPEG File|jpg|JPEG" or type 
"GIF File|gif|GIFf"
   put the result into tResult
   put it && tResult
end mouseUp

I typed in a file name without an extension. The message box contained 
the path to the file and "JPEG File".

Will that work for you?

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the use-livecode mailing list