[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


autohotkey when looping through files in a folder it only puts the path and the file extension while leaving out the filename

Posted on 2014-07-14
Medium Priority
Last Modified: 2014-07-14
I find that auto hotkey is leaving out the name of a file when looping through the files in a folder here is the code
FileSelectfile, C:\Users\Benjamin\Documents\Nomi's stuff\record quick\*.*, 0, 0

send, %A_LoopFileName%

Open in new window

%A_LoopFileName% returns :\Users\Benjamin\Documents\Nomi's stuff\record quick\.mp3
notice in >>>>>>\.mp3 the filename is missing and so does the c at the beginning of the path disappear
like what the h ... is going on I ma using windows 8
Question by:Dov_B
1 Comment
LVL 57

Accepted Solution

Joe Winograd, EE MVE 2015&2016 earned 2000 total points
ID: 40195848
First, A_LoopFileName is the name of the file (or folder) without the path. A_LoopFileFullPath is the path and name of the file (or folder).

Second, the syntax of the FileSelectFile command is:

FileSelectFile, OutputVar [, Options, RootDir\Filename, Prompt, Filter]

So this line of code is not right:

FileSelectfile, C:\Users\Benjamin\Documents\Nomi's stuff\record quick\*.*, 0, 0

There are two problems with it: (1) The first parameter is supposed to be the name of the variable in which to store the filenames selected. You seem to have made it a wildcard. (2) The first "0" is in the Option param, which is fine — the same as having no Options. But the second "0" is in the RootDir\Filename param, which is certainly not what you want. Regards, Joe

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question