cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Default file name in file_selector() dialog box

jsulak
1-Newbie

Default file name in file_selector() dialog box

Hello Adepters,

I'm using the file_selector() function to create a "Save As" dialog:

file_selector(".", "doc", "Word Documents|*.doc", "Save Word Document
As", 0x02+0x04)

Is there any way to specify a default value for the "File Name" field in
the resulting dialog box? I'm using ACL at the moment, but I'm also
okay with using the AOM.

Thanks,

-James



3 REPLIES 3
bibach
1-Newbie
(To:jsulak)

Hey, James...

The file_selector() function does most, but not quite all, of what's
possible by directly calling the Win32 function for an Open/Save
dialog. That's part of what would make me hesitate to switch to doing
the Win32 call, since it would involve a bunch more work just to
accomplish the same thing as you're doing right now with just a single
line of code. However, so far as I can tell, that's probably what it
would take to accomplish this, other than doing something like a
custom XUI, which would also be a fair bit of work, but possibly of a
more comfortable sort, depending upon your tastes.

If you're interested in the Win32 route, the function you'll want to
look at is called GetSaveFileName. It requires reading and writing a
structure, which you can do with the unpack() and pack() functions,
respectively.

-Brandon 🙂

jsulak
1-Newbie
(To:jsulak)

Thanks, Brandon. That sounds like a lot of work. I'm going to attempt the (possibly) simpler solution of getting our users to agree with me that they don't actually need it. 🙂

-James

My favorite solution!

Top Tags