Jump to content
Sign in to follow this  
smashly

FileSaveDialog() and selected filter.

Recommended Posts

smashly

Hi,

FileSaveDialog() doesn't return an extension of the filter used.

So for example I offer a user to save an image as the format they want.

I set the filter param with "Bitmap (*.bmp)|GIF (*.gif)|JPEG (*.jpg)|PNG (*.png)"

The user selects from the "Save as type:" *.png and types a file name with no extension to save.

But FileSaveDialog() only returns the path\filename but without an extension or filter chosen.

So I have no way of knowing what filter the user selected..

Makes me wonder why there's even a "Save as type:" filter choice in the first place.

Am I missing something?

TYIA

Edited by smashly

Share this post


Link to post
Share on other sites
smashly

NVM, found a workaround Here (2+ Year old post).

Just in case anyone was curious.

Cheers

Edited by smashly

Share this post


Link to post
Share on other sites
wakillon

Try to open notepad and save as

type a name , it will be save without extension ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
smashly

Hi,

Your wrong... my windows notepad saves an extension even when I do not type one in.

But that's not the point.

I don't care about the extension being added, it's that I don't know the filter the user selected.

The point is AutoIt's built in FileSaveDialog() pretty well useless under certain circumstances.

If it doesn't return a Filter or Add an extension when a filter is chosen then what's the point of setting "Save as type:" filters

Cheers

Edited by smashly

Share this post


Link to post
Share on other sites
wakillon

I understand what you mean.

I just do a comparison with notepad ( who doesn't add extension for mine )

when you say you 're missing something !

So, for me there was no differences, so no problem !


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×