 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
slken
Joined: 27 Dec 2005 Posts: 3
|
Posted: Fri Jan 06, 2006 9:59 am Post subject: String Manipulation |
|
|
I'm referencing %A_LoopFileName% in the statement below:
WinMenuSelectItem,%A_LoopFileName%,,File,Export As MP3...
But I want to use the filename without the extension.
I know I can assign the fullname to a variable like this:
myFileName = %A_LoopFileName%
But how do I remove the last extension from the end? I can't seem to find the string manipulation functions in the documentation.
Once I have the right value in my variable.
Do I simply use it like this:
WinMenuSelectItem,myFileName,,File,Export As MP3...
Thanks. |
|
| Back to top |
|
 |
Rabiator
Joined: 17 Apr 2005 Posts: 265 Location: Sauerland
|
Posted: Fri Jan 06, 2006 11:01 am Post subject: Re: String Manipulation |
|
|
| Quote: | | But I want to use the filename without the extension. | You can extract it with SplitPath. |
|
| Back to top |
|
 |
JSLover
Joined: 20 Dec 2004 Posts: 542 Location: LooseChange911.com... the WTC attacks were done by the US Gov't... the official story is a lie...
|
Posted: Fri Jan 06, 2006 12:19 pm Post subject: Re: String Manipulation |
|
|
| slken wrote: | I'm referencing %A_LoopFileName% in the statement below:
WinMenuSelectItem,%A_LoopFileName%,,File,Export As MP3... |
| slken wrote: | Do I simply use it like this:
WinMenuSelectItem,myFileName,,File,Export As MP3... |
...now why would you use %'s (percents) on A_LoopFileName but not on myFileName?...you wouldn't! If one variable uses %'s then so does the other...(if one doesn't, neither does the other {in the case of expressions}).
| SplitPath wrote: | | SplitPath, InputVar [, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive] |
| Code: | | SplitPath, A_LoopFileName, , , , A_LoopFileNameNoExt |
_________________
Home • Click image! • Blog |
|
| Back to top |
|
 |
Decarlo110
Joined: 15 Dec 2004 Posts: 303 Location: United States
|
Posted: Fri Jan 06, 2006 4:30 pm Post subject: |
|
|
| Quote: | | how do I remove the last extension from the end? |
Presuming the extension is 3 chars long plus the dot, you could use:
| Code: | StringTrimRight, A_LoopFileName_Trimmed, A_LoopFileName, 4
|
The String manipulation functions can be found in Helpfile > Index > String__
and online at Alphabetical Command Reference
and in Helpfile > Contents > String Management. _________________ 1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php
2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>> |
|
| 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
|