There are two methods that work -- one is the Globalpaths plugin -- however, I had some errors with it -- and why include another file in your project, when a few lines of code will do it -- drop this into your "Global functions"
Code:
function System.LaunchFolder()
local cProgramFolder = _SourceFolder;
if Table.Count(_CommandLineArgs) > 0 then
local x;
for x=Table.Count(_CommandLineArgs),1,-1 do
-- The SFXSource is always at the end/last -so we look there 1st -- however, it's not specified in the docs
-- so we scan the whole thing 'just in case' -- and if this changes in future versions of AMS....
if String.Left(_CommandLineArgs[x], 10) == "SFXSOURCE:" then
local tPath = String.Replace(_CommandLineArgs[x], "SFXSOURCE:", "", true)
tPath = String.SplitPath(tPath)
cProgramFolder = tPath.Drive..tPath.Folder
break; -- we have the real start path, so leave the loop!
end -- if
end -- for loop
end
return cProgramFolder;
end
I cannot take credit for the code, but mine is somewhat modified from the original.
Leave a comment: