 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Icarus
Joined: 24 Nov 2005 Posts: 323
|
Posted: Tue May 06, 2008 9:05 pm Post subject: FileSelectFile + SplitPath Extension return with newline |
|
|
Not sure if this is by design, or if it is a windows quirk, or if it is a bug.
FileSelectFile returns its result with a newline.
Now, if this is how its supposed to be, I think the SplitPath command should at least consider this.
Right now, the extension returns with a newline.
Reproduction code:
(Both MsgBoxes below will print a newline after the variable, and they shouldn't)
| Code: |
FileSelectFile SelectedFile, 4, %A_ScriptDir%, Select Any File, All Files (*.*)
If( ErrorLevel )
Return
Else {
SplitPath SelectedFile, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive
MsgBox The selected file is:`n[%SelectedFile%]
MsgBox The extension is:`n[%OutExtension%]
}
|
|
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 753 Location: London, UK
|
Posted: Tue May 06, 2008 9:45 pm Post subject: |
|
|
| Quote: | | Obsolete option: In v1.0.25.06+, the multi-select option "4" is obsolete. However, for compatibility with older scripts, it still functions as it did before. Specifically, if the user selects only one file, OutputVar will contain its full path and name followed by a linefeed (`n) character. If the user selects more than one file, the format is the same as that of the M option described above, except that the last item also ends in a linefeed (`n). |
_________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 323
|
Posted: Tue May 06, 2008 10:19 pm Post subject: |
|
|
Thanks.
Missed it.
Dont know why I used 4 anyway...
Still, SplitPath should remove any newlines. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|