Page 1 of 1

Drop file on Script issue - brakes path down by spaces

Posted: 21 Jan 2018, 22:00
by theimmersion
I tried making some gif player but i noticed that dropping anything on a script (uncompiled) is returning weird results.
I expected it to return a path but instead it returns parts of the path.
For instance, dropping some file would place some number like 7 in the %0% param and place different parts of the path in %1% - %7%
Essentially, its braking down the path by spaces in the string.
An example as it currently is:
Gif file location:
D:\AHK's Stuff\Test projects and script development\assets\anim test\2.gif

dropping the file on a script returns this:
%0%=7
%1%=D:\AHK's
%2%=Stuff\Test
%3%=projects
%4%=and
%5%=script
%6%=development\assets\anim
%7%=test\2.gif

Is this some bug or am i using this the wrong way?? Is this intentional?
I could not find anything relevant to this behavior.
So confusing. xD

Edit:
Essentially, dropping a file with any spaces in the path is making the script think theres multiple parameters, depending on how many spaces there are.

Re: Drop file on Script issue - brakes path down by spaces

Posted: 21 Jan 2018, 22:19
by TAC109
There's an option when installing AHK to allow files to be dropped onto scripts. Did you enable this option when installing?

Alternatively, you can compile the script. Dropping files onto the compiled script will work regardless.

Re: Drop file on Script issue - brakes path down by spaces

Posted: 22 Jan 2018, 17:11
by theimmersion
Yeah, i did not enable this. Honestly, i did not notice that at all. Time to reinstall AHK i guess. Thanks. An option would be nice within the auto execute section tho. Something like #EnableDragDrop / #EDD / #EnableDD or some such (if possible of course). I honestly think i subbed to this topic and yet it was unsubbed somehow. Hm.... Need sleep i guess. xD Thanks!

Re: Drop file on Script issue - brakes path down by spaces

Posted: 22 Jan 2018, 17:19
by theimmersion
Ok, i reinstalled AHK and yes, the option was checked (enabled) and the behavior is still the same.
I know compiled scripts work but i need it uncompiled since its on my own system for my own use and i modify the script a lot and compiling after each iteration is annoying.