Quote
JamesD
The following line does not work.
exec("C:\\Program Files\\k-meleon\\Profiles\\default\\ae3wngxv.slt\\macros\\sounder.exe \""C:\\Program Files\\k-meleon\\Profiles\\default\\ae3wngxv.slt\\macros\\chimes.wav"\"");
This can indeed not work. You made several mistakes with the quotes.
1) The argument for the exec statement goes into double quotes i.e. it begins with " and ends with ".
2) Any part of the command line (i.e. the program's path and any parameters) that does or can contain white spaces should go into additional double quotes (\", quotes inside quotes have to be escaped). But, in case of doubt, this depends on the program you want to execute.
These rules applied:
exec("
\"C:\\Program Files\\k-meleon\\Profiles\\default\\ae3wngxv.slt\\macros\\sounder.exe
\" \"C:\\Program Files\\k-meleon\\Profiles\\default\\ae3wngxv.slt\\macros\\chimes.wav
\"");
To locate the user macro folder we've the getfolder() method:
exec("
\"".getfolder(UserMacroFolder)."\\sounder.exe
\" \"".getfolder(UserMacroFolder)."\\chimes.wav
\"");
Quote
JamesD
Sounder says only relative paths supported. What is a relative path? What is the working directory when KM is running?
A relative path is taken relative to the current (or working) directory. When nothing else is specified, the working directory of an application is the directory that contains the application's executable. So, the working directory of sounder.exe should be the directory where sounder.exe is located.
When chimes.wav is located in the same directory as sounder.exe, the path of chimes.wav relative to sounder.exe is chimes.wav:
exec("
\"".getfolder(UserMacroFolder)."\\sounder.exe
\" chimes.wav");
(I don't want to confuse you with parent and subdirectories