Simon 5 is coming soon!
Simon version 5 is currently in beta testing. It is a massive update, introducing a much-requested feature: syncing the Simon data between multiple Macs, plus a Simon Status service, a Link Checker filter, improved Find filter, iMessage and Speak Error notifiers, a new app icon, and much more.
Important: please note that Simon 5 requires a minimum of macOS 10.12 (Sierra), and will be a paid upgrade from Simon 4 after the beta. Purchasers since September 1, 2020 automatically get a version 5 license (that also works in previous versions).
AFP Support
What good timing for your suggestion! I'm in the beginnng stages of adding AFP test support for Simon. Hopefully we can get it realeased as part of an update in a few weeks.
In order to give the best benefit, I am interested in getting thoughts from users as to what features they'd like to see from an AFP bsed test. It sounds like you're a little familiar with the AFP client framework. Any feedback about what you'd like to see would be much appreciated. We want to see you get the most out of Simon after all.
So, if anybody has any ideas, don't be shy.
Daniel
How to tell Simon a failure occurred
I have begun to try and refine the AppleScript we're currently using. I'm completely amateur at this. So any help gratefully received. Here is where I'm at now:
tell application "Finder"
if exists disk "{TestShare}" then
try
eject disk "{TestShare}"
on error
display alert "The volume {TestShare} failed to unmount" as informational buttons "OK" default button "OK"
end try
else
try
mount volume "afp://{Username}:{Password}@{ServerIP}/{TestShare}"
on error
display alert "The volume {TestShare} failed to mount" as informational buttons "OK" default button "OK"
end try
delay 5
if exists disk "{TestShare}" then
try
eject disk "{TestShare}"
on error
display alert "The volume {TestShare} failed to unmount" as informational buttons "OK" default button "OK"
end try
end if
end if
end tell
That's a little more graceful than the original. We only have the dialog appearing in the above because I don't know what else to do with an error.
We still need to figure out how to tell Simon when a failure occurs. We don't want the Finder informing the user. We want to inform Simon. I'm sure this is just a matter of knowing AppleScript. How do we get the script to return a result that will then feedback to Simon and trigger a fail without displaying a dialog in the Finder.
This is a significant issue because if one server fails for a random reason, it holds up the Finder and all subsequent tests begin to fail. This results in our Simon notification forum becoming flooded with failures - when there aren't any out there in the real world. Example failures are authentication failures. This seems to occur for some unknown reason. That's another issue. This triggers a dialog which insists on a human response. Meanwhile Simon can't use the mount command again it begins to fail everybody else. I have also contacted Apple regarding the mount command perhaps ungracefully handling failing mounts. It actually causes a lock-up of the Finder.
Thanks.
Could be working actually
I have just completed some tests of the above. I hope I'm not jumping the gun. It appears that the errors are being gracefully handled by Simon. After a 2 minute timeout Simon fails the test and no disturbing errors hold everybody else up.
My only concern now is the timings clashes. It does appear that when the mount fails there is a two minute timeout which may prevent subsequent mounts during that two minute period.
I will leave this to soak and we'll see what happens next.
Re: How to tell Simon a failure occurred
That looks pretty good. The piece you're missing is the return statement: instead of displaying an alert, just call return 10 (or any number you like), and add a result line in the Script service for that result number. On success, call return 0, and have that as the Success result in the Script service.