file browse multiple filters

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

file browse multiple filters

Post by kpassaur » Mon May 07, 2012 9:42 am

To enter a filter to limit the file browse button I enter it as

pdf files|*.pdf

However, I need to add an additonal filter, I want to also add tif files. So the user has to select a tif or a PDF. How do I add the line tif files|*.tif to it. I cannot recall what to use and could not find it in the help section. (perhaps that is just me) I tried multiline edit and it did not work (didn't think it would). Could someone refresh my memory on this.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon May 07, 2012 1:28 pm

Code: Select all

Filter = 'Tif files (*.tif)|*.TIF|Pdf file (*.pdf)|*.PDF'

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Filter

Post by kpassaur » Mon May 07, 2012 2:43 pm

Thanks, I'II give it a go.

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Wed Sep 12, 2012 6:26 pm

I thnk I remember seeing how to have mutiple file types at the same time, but I can't find that post...

What I want is: Our File types (*.TXT, *.PDF)|*.TXT, *.PDF
and then user sees all TXT and PDFs at once

But this shows nothing.

I can break these apart into separate entries and it works fine.

Is there a way to show both at once?
Thanks,
Jerry

[email protected]

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Sep 12, 2012 6:43 pm

Doesn't the code in JRL's post earlier in this thread (Mon May 07, 2012 1:28 pm) do what you want?

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Wed Sep 12, 2012 7:03 pm

That shows 1 type of file at a time
I can see TXT files OR PDFs

I am greedy and want to see TXT AND PDFs at the same time...
Thanks,
Jerry

[email protected]

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Sep 12, 2012 7:22 pm

Ah, understood.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Sep 12, 2012 8:34 pm

Unfortunately you can't do that. Windows browse dialogs just don't work that way. You could do a *.* filter. But that would show everything.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Wed Sep 12, 2012 9:14 pm

Ok, Thanks for the info.
Thanks,
Jerry

[email protected]

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Sep 13, 2012 3:28 am

All you need to do to is separate the items with semicolons and you can have multiple file types display in one pane. Run Word or Excel and select "Open" and you can see this demonstrated in the filters list box (just below where you would enter a file name to be opened).

Code: Select all

Filter = 'Various file types (*.txt; *.pdf; *.jpg)|*.txt; *.pdf; *.jpg|Any file (*.*)|*.*'

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 13, 2012 5:57 am

Ahah! I stand corrected.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Thu Sep 13, 2012 2:46 pm

Many Thanks JRL!
Thanks,
Jerry

[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts