Custom Ask File Dialogs

Richard Gaskin ambassador at
Sat Jul 11 09:36:05 EDT 2015

Ray wrote:

 > Does anybody know of a way to duplicate Livecode's "Ask File" dialog
 > window and customize it?  I suppose I could build up my own Ask File
 > dialog window from scratch but it would be a lot of work and I'm not
 > sure how I would include things like Favorites and the many different
 > views the Ask File dialog window has.
 > In my research so far I've experimented unsuccessfully with the sheet
 > command.  I've also set the "systemFileSelector" property to true in
 > order to use Livecode's built-in dialog box.  I'm just not sure where
 > to go to duplicate it so I can customize it.

For the "answer file" command LiveCode uses the OS-provided dialog on 
all platforms.

They used to use a custom dialog for Unix, and still provide it as an 
option in the Linux standalone settings so it's in there somewhere, but 
it's not nearly as nice as the OS version that's now very well supported 
with Fraser Gordon's excellent GDK integration for that platform, and 
their custom dialog looks especially bad on OS X or Windows where it was 
never designed to be used.

It's been a while since I've looked into the OS APIs for extending the 
file selector dialog, and even then it was for Mac Classic so it would 
likely be of no use today even on OS X.

But I would imagine that a similar set of hooks remain in modern APIs, 
and that it may be possible to write an external for v7 that could 
extend that dialog, or wait until v8 and use the built-in support for 
calling OS APIs from LiveCode Builder.

For the here-and-now, when I need additional options for special file 
handling I'll usually just use a sequence of two dialogs:

1. answer file to pick the file
2. Display the selected file in a second custom modal that provides the 
other options I need.

I might be a bit smoother to have it all in one window, but apparently 
customizing the file selector dialog isn't the easiest thing to do, 
since I see at good many apps use a two-dialog sequence for such things 
- at least we're in good company.

  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  Ambassador at      

More information about the Use-livecode mailing list