Getting Working directory & concatenating 2 stringds
Posted: 30 Jul 2021, 17:15
Hi,
Autohokey is essential for me, but I wrote only 4 scripts so far, mostly by example, so I do not know really its syntax like I know C for example.
I need 2 things:
1) A way to set a variable to the working directory of the Windows I clicked on. I don't want the executable directory, but the directory that getcwd() would return in C
2) I have parsed the title of the Window of my app, and got a %Filename% containing the name of the file the app (SubtiltEdit.exe) was called with.
Unfortunately, with the last release, if you use:
SubtiltEdit.exe d:\MySubs\test.srt
the windows title contains only test.srt, and I need to know "d:\MySubs". I could not find how in the help, a bit clumsy of my part since that API must exists.
If somebody could show the syntax to get that into %dir% it would be appreciated.
3) I need to know the syntax to concatenate them %Filename% and %dir% into a variable named for example FilenameFul.
I tried:
FilenameFull := %A_WorkingDir% & / & %FileName%"
to see if that works (%A_WorkingDir% is NOT what getcwd() would return), but this does not work, so this is not the correct way to concatenate 2 strings (actually 3, since I need a "/" in between).
Thanks in advance for any help.
Autohokey is essential for me, but I wrote only 4 scripts so far, mostly by example, so I do not know really its syntax like I know C for example.
I need 2 things:
1) A way to set a variable to the working directory of the Windows I clicked on. I don't want the executable directory, but the directory that getcwd() would return in C
2) I have parsed the title of the Window of my app, and got a %Filename% containing the name of the file the app (SubtiltEdit.exe) was called with.
Unfortunately, with the last release, if you use:
SubtiltEdit.exe d:\MySubs\test.srt
the windows title contains only test.srt, and I need to know "d:\MySubs". I could not find how in the help, a bit clumsy of my part since that API must exists.
If somebody could show the syntax to get that into %dir% it would be appreciated.
3) I need to know the syntax to concatenate them %Filename% and %dir% into a variable named for example FilenameFul.
I tried:
FilenameFull := %A_WorkingDir% & / & %FileName%"
to see if that works (%A_WorkingDir% is NOT what getcwd() would return), but this does not work, so this is not the correct way to concatenate 2 strings (actually 3, since I need a "/" in between).
Thanks in advance for any help.