Page 2 of 2

Re: FileSelectFile() : Supports multi-line filter

Posted: 29 Sep 2020, 21:34
by Peaceful
same as foobar2000 and Media Player

foobar2000 screenshot:
Image

So many apps are this style.
That's perfect.

Re: FileSelectFile() : Supports multi-line filter

Posted: 30 Sep 2020, 03:58
by SKAN
gwarble wrote:
29 Sep 2020, 14:53
Thanks

Well I wouldn't want you to put an ugly trick in your elegant function, but if you came up with one I'd probably use it, as we treat no extension just like any other extension usually driven by the machine tool's software and/or interface (ethernet or memory card) requirements. Its surely not desperately needed as I've gotten by without it for this long :)
I've been trying hard.. No joy.. yet. :(

If I was in such situation, I might work around as follows
1) make a list of files without extension
2) create a temp folder
3) create shortcuts for each file.
4) show dialog for the temp folder
5) delete temp folder after dialog is dismissed.

But instead of all this trouble, It would be better to create a custom TreeView based UI :(

FileSelectFile() : v0.72

Posted: 30 Sep 2020, 04:02
by SKAN
Code updated:

0.72A_LastError will contain the index of selected Filter. (Valid only if ErrorLevel is 0)

 
Demo script:
 

Code: Select all

#NoEnv
#SingleInstance, Force

Filter := "|Run with AutoHotkeyA32.exe (*.ahk)|Run with AutoHotkeyU32.exe (*.ahk)||Run with AutoHotkeyU64.exe (*.ahk)"
Selection := ["AutoHotkeyA32.exe", "AutoHotkeyU32.exe", "AutoHotkeyU64.exe"]

File := FileSelectFile( 1,,"Select script & interpreter", Filter)
If ! (ErrorLevel)
   MsgBox,,User choice, % "Run`n" . File . "`nwith`n" . Selection[A_LastError]

; Paste FileSelectFile() below
 
Image

Re: FileSelectFile() : Supports multi-line filter

Posted: 30 Sep 2020, 14:20
by gwarble
SKAN wrote:
30 Sep 2020, 03:58
But instead of all this trouble, It would be better to create a custom TreeView based UI :(
Thanks for looking in to it...

using different directories and shortcuts would be too cumbersome and problematic of a solution but I like the creative thinking... because most of the files we deal with are either named in the format "O1234" or "O2345 (COMMENT)" and your filtering allows for more than just extensions, I'm starting with something like:

All Documents (*.*)|NC Code (*0;*1;*2;*3;*4;*5;*6;*7;*8;*9;*)*)|AutoHotkey (*.ahk)|Heidenhein (*.H)

Which catches all files that end with a number or a right-parenthesis.

Re: FileSelectFile() : Supports multi-line filter

Posted: 30 Sep 2020, 15:12
by SKAN
gwarble wrote:
30 Sep 2020, 14:20
All Documents (*.*)|NC Code (*0;*1;*2;*3;*4;*5;*6;*7;*8;*9;*)*)|AutoHotkey (*.ahk)|Heidenhein (*.H)
Nice! But if I make copies of files in explorer, the file copies end with Copy (2) .. Copy(3) and so on.
I just realized the extensions cannot have open parenthesis in it, as I split the filter line at the last occurring (.

Re: FileSelectFile() : Supports multi-line filter

Posted: 30 Sep 2020, 15:35
by gwarble
ah yes that explains why "*)" wasn't working without that last *

Re: FileSelectFile() : Supports multi-line filter

Posted: 07 Dec 2020, 17:46
by hasantr
Hi @SKAN Our job is very easy with your functions. Thank you.

How can I use this function to select folders? The built-in FileSelectFolder isn't powerful enough.

Re: FileSelectFile() : Supports multi-line filter

Posted: 07 Dec 2020, 18:53
by robodesign
hasantr wrote:
07 Dec 2020, 17:46
Hi @SKAN Our job is very easy with your functions. Thank you.

How can I use this function to select folders? The built-in FileSelectFolder isn't powerful enough.
This function offers the ability...
https://github.com/marius-sucan/other-small-AHK-scripts/blob/master/select-folder-extended.ahk

Best regards, Marius.

Re: FileSelectFile() : Supports multi-line filter

Posted: 07 Dec 2020, 19:20
by hasantr
robodesign wrote:
07 Dec 2020, 18:53
hasantr wrote:
07 Dec 2020, 17:46
Hi @SKAN Our job is very easy with your functions. Thank you.

How can I use this function to select folders? The built-in FileSelectFolder isn't powerful enough.
This function offers the ability...
https://github.com/marius-sucan/other-small-AHK-scripts/blob/master/select-folder-extended.ahk

Best regards, Marius.
This is great. Thank you so much.

Re: FileSelectFile() : Supports multi-line filter

Posted: 04 Jan 2021, 12:53
by hasantr
I can't filter lnk files. Shortcut files always appear. Is there any way to hide shortcut files?