As Jonathan said, we’ll consider adding a runscript command-line option for this in the future. In the meantime, it’s possible to hack something together using a script. Here’s a little script that will set the ResultsFolder in the SuiteInfo file of a script:
(** SetResultsFolder.script
This script sets the results folder of a suite. Call this script to set the results folder prior to running any scripts in the suite.
**)
params pathToSuite, newResultsFolder
if pathToSuite is empty
answer folder "Select a Suite"
if it is empty then exit all
put it into pathToSuite
end if
if newResultsFolder is empty then
answer folder "Choose the results folder"
if it is empty then exit all
put it into newResultsFolder
end if
// find the SuiteInfo file
set infoFile to pathToSuite & "/SuiteInfo"
if there is no file infoFile then
put "There is no file " & infoFile
put "Unable to set results folder"
exit all
end if
// read the suiteInfo file
put file infoFile into suiteInfo
// find the current definition of the results folder
put offset of "ResultsFolder = " in suiteInfo into startLoc
put offset of return within suiteInfo after startLoc into endLoc
// if results folder isn't already specified, prepare to insert rather than replace
if startLoc is zero then set startLoc to endLoc+1
// replace (or insert) the new definition
put "ResultsFolder = " & quote & newResultsFolder & quote & ";" & return \
into chars startLoc to endLoc of suiteInfo
// rewrite the suiteInfo file with the new result location
put suiteInfo into file infoFile
You should probably run this when the suite isn’t open in Eggplant (otherwise Eggplant is likely to overwrite your change). If you call this script from the command line be sure to pass both the path to the suite and the desired results folder as parameters. Otherwise it will try to use the “answer folder” command to ask the user for them, but the ask and answer commands don’t work when running from the command line.
To do exactly what you’ve asked for you’ll want to save the previous result folder setting somewhere (either by modifying this script or through some other mechanism) and then restore it again afterward. Good luck!