How Can I Restrict File Type in DTP Path Control?

Running Dialog Toolkit Plus 1.1.2 on macOS 10.14.6 (Mojave)

From the Dialog Toolkit Plus Dictionary:

create path control (verb) Create a path control. (from Alert Suite)
FUNCTION SYNTAX
set theResult to create path control text ¬
left inset integer ¬
bottom integer ¬
control width integer ¬
pops up boolean

Is it possible to restrict the user’s choice to a specific file type, like we can with the standard choose file dialog?

The path control has an allowedTypes property, which takes a list of extensions or UTIs. The docs say it was introduced in 10.10, but I think that’s when it became a property — I’m fairly sure setAllowedTypes: will work in 10.9 also.

Thanks for the quick reply.

What am I doing wrong? Neither of these commands will compile after I add the allowedTypes property:

set {sourceFilePath, pathLabel, theTop} to ¬
create labeled path control (defaultFolderPath)  bottom (theTop + 12) control width ¬
accViewWidth allowedTypes {"public.plain-text"} ¬
label text "Choose (or drag) TEXT File with List of Notebooks here:" ¬
with pops up 
set {sourceFilePath, pathLabel, theTop} to ¬
create labeled path control (defaultFolderPath)  bottom (theTop + 12) control width ¬
accViewWidth setAllowedTypes {"public.plain-text"} ¬
label text "Choose (or drag) TEXT File with List of Notebooks here:" ¬
with pops up 

It’s not part of Dialog Toolkit. You will have to modify your copy to include it.

Shane, OK, thanks for clarifying that. Didn’t get that from your post above.

So, this seems like a use case that is worthy of an official update to DTP.
Since it is an optional parameter, it won’t break anyone’s script.
And since it uses the same data as choose file, it should be easily understood.

Please accept this as a new feature request.

Thanks.

Yes, it’s a pretty obvious omission. It’s on my (mental) list, although realistically it’s unlikely in the near term.

OK, thanks for adding my request to your list.
Until it is available, I will have to continue to use the std choose file because restricting file type is critical to most of my use cases.