same as foobar2000 and Media Player
foobar2000 screenshot:
So many apps are this style.
That's perfect.
FileSelectFile() : Supports multi-line filter
Re: FileSelectFile() : Supports multi-line filter
I've been trying hard.. No joy.. yet.gwarble wrote: ↑29 Sep 2020, 14:53Thanks
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
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
Code updated:
0.72 : A_LastError will contain the index of selected Filter. (Valid only if ErrorLevel is 0)
Demo script:
0.72 : A_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
Re: FileSelectFile() : Supports multi-line filter
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.
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Re: FileSelectFile() : Supports multi-line filter
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
ah yes that explains why "*)" wasn't working without that last *
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Re: FileSelectFile() : Supports multi-line filter
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.
How can I use this function to select folders? The built-in FileSelectFolder isn't powerful enough.
-
- Posts: 934
- Joined: 30 Sep 2017, 03:59
- Location: Romania
- Contact:
Re: FileSelectFile() : Supports multi-line filter
This function offers the ability...
https://github.com/marius-sucan/other-small-AHK-scripts/blob/master/select-folder-extended.ahk
Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
Re: FileSelectFile() : Supports multi-line filter
This is great. Thank you so much.robodesign wrote: ↑07 Dec 2020, 18:53This 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
I can't filter lnk files. Shortcut files always appear. Is there any way to hide shortcut files?
-
- Posts: 6
- Joined: 01 Mar 2021, 05:43
Re: FileSelectFile() : Supports multi-line filter
Hi, @SKAN, I tried this function but I get a strange result. Here's the code I used:
I type "1" in the select window and I get this:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases
SendMode Input ; Recommended for new scripts due to its superior speed and reliability
#SingleInstance, Force ; Allow only one running instance of script
#Warn All, MsgBox ; Enable warnings to assist with detecting common errors
path := FileSelectFile("S16|||" . WinExist("A"), "C:\Downloads\AutoHotkey Test Script.ahk","Duplica File","|Tutti i file (*.*)")
if (path != "")
{
msgbox % path
}
return
FileSelectFile( Options:="", RootDir:="", Title:="", Filter:="" ) { ; v0.72 by SKAN on D39R/D39U
...
}
"123.abc" gives this:---------------------------
AutoHotkey Test Script.ahk
---------------------------
C:\Downloads\1
Script.ahk
---------------------------
OK
---------------------------
---------------------------
AutoHotkey Test Script.ahk
---------------------------
C:\Downloads\123.abc
t.ahk
---------------------------
OK
---------------------------
-
- Posts: 6
- Joined: 01 Mar 2021, 05:43
Re: FileSelectFile() : Supports multi-line filter
I'm able to reproduce the said glitch.
Can you please help me to fix it?
If you may...
Please replace line 60
from
Code: Select all
OutputVar .= Line . "`n", f += ( (StrLen(Line)+1) * x )
Code: Select all
OutputVar .= Line . "`n", f += ( (StrLen(Line)+( o="m" ? 1 : 0 ) ) * x )
-
- Posts: 6
- Joined: 01 Mar 2021, 05:43
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 76 guests