Quote
slayer
I think Windows doesn't care about the folders being uppercase, lowercase or mixed. So, you will need to work with upper case letters in your macro.
Haha :cool: ;-)
That's exactly the problem, win98 doesn't care about the case, but the comparing functions in KM do very much. So if a user is asked by a macro to choose a folder, the result is mixed-case. Now if the macro compares that path with the KM folder it will ALWAYS declare the user-path were outside. How to "work with that"??
Perhaps there's some elegant function to convert cases, perhaps with js or whatever, but never mind. For now I'll use a (rather lousy) workaround, to check if a promptforfile path ($_xypath) is inside the KM root folder:
Count how many characters the rootfolder has, lets say it's 15, then take the first 15 characters of the promptforfile-path, cut the rest of its path, append \defaults\pref\kmeleon.js, and look if that exists...
readfile(substr($_xypath,0,length(getfolder(RootFolder)))."\\defaults\\pref\\kmeleon.js")==""?
Funnily, getfolder only gives the ROOT of the folders in uppercase! If there's more afterwards, like for "macrofolder" or "profilefolder", those parts will have normal cases. Example for "
getfolder(macrofolder)":
in xp -> D:\testPaTh\K-Meleon\macros
in win9x -> D:\TESTPATH\K-MELEON\macros
BTW I'm also struggling with the
readfile command, if used for checking if a file in a local path exists. Meaning in a
local usb-stick compatible path "tools\..." instead of "c:\programs\k-meleon\tools\..."
Funnily local paths work fine for everything, calling programs and files from there, except for readfile. It either gets a full path or it finds nothing
Using a workaround for that too, but of course the macros look more and more confusing that way :-/
Edited 3 time(s). Last edit at 01/20/2010 02:18PM by siria.