My AutoIt script :
WinWaitActive("Open")
Send($CmdLine[1])
Send("{ENTER}")
I execute it from Java (passing a filepath to it):
String autoITExecutable = "C:\\filechooser.exe " + fileSource;
Name of file contains spaces, so it reads filename up to the first space and ignores the remainder. How do I correctly pass filepaths containing spaces as command line argument?
As per Documentation - Intro - Running Scripts:
Without, text after space will be contained by next array element (
$CmdLine[2]
in this case). Java example:Unprocessed command line (single string) is available as per
$CmdLineRaw
from receiving AutoIt script.