I want to use the status property of ScriptResults inside an if statement to send an e-mail if a script I am running fails for whatever reason. I imagine it looking something like this-
RunWithNewResults "TestScript.script"
repeat
if (Running)
wait 120
else if (Failed)
sendmail(blah)
end repeat
else if (Success)
end repeat
end if
the problem is, I’m not sure how to access the status property of ScriptResults(“TestScript.script”) and compare it in the if statement.
RunWithNewResults ?InitialTest?
put the result into Outcome
// If the result of ?InitialTest? is not "Success"
if the status of Outcome is not ?Success? then
SendMail(....)
end if
Awesome, thank you. IN addition, I need to be able to get the suite to run every morning, but I’m not sure how to use crontab or anything to do so, so basically I’d like to see how it’s done from the command line.
For cron jobs you can use a convenient utility called Cronnix.
Eggplant’s command line syntax as well as available command line options can be found in the “Eggplant Reference” manual. Type “Command Line” in the search field and the relevant pages should appear.
[quote=“EPJoK”]For cron jobs you can use a convenient utility called Cronnix.
Eggplant’s command line syntax as well as available command line options can be found in the “Eggplant Reference” manual. Type “Command Line” in the search field and the relevant pages should appear.[/quote]
Awesome again, that did the job perfectly. Now, how can I send a quotation mark via TypeText? There doesn’t seem to be a TypeText modifier for it, and just putting in there plainly doesn’t catch.
If you move the quotation mark after “Public” to come after “guest” and insert another ampersand (&) after mount_afp it becomes valid (not sure if it’s exactly what you want, of course – that’s up to you to decide):
Just keep in mind that quotes have to be used in pairs, and you need to use & between all of the different parts you’re combining.
I strongly recommend turning on the “Update colors continuously while typing” feature (found in Preferences -> Script -> Colorization). This will give you constant feedback as you type so you’ll know when the syntax is correct.