We have various shell scripts in which we open or directly execute a policy in the self service as follows:
open "jamfselfservice://content?entity=policy&id=10&action=view"
Since the update from 11.4.1 to 11.7.1, we have noticed the problem that the following error message appears when we open / execute such a policy (unfortunately I can't insert a screenshot, I don't seem to have any permissions):
Self Service quit unexpectedly.
Click Reopen to open the application again.
Click Report to see more detailed information and send a report to Apple.
if you first open the Self Service app and then execute the command, it works.
Does anyone else have this problem?
Our workaround is now to open self Serivce first, and then wait with a sleep 5 until hopefully the app is started, so that the URL command can be executed afterwards.
open "/Applications/Self Service.app"
sleep 5
open "jamfselfservice://content?entity=policy&id=54&action=view"
This works, but is suboptimal, as the 5 seconds are either too long or too short, depending on the Mac model.
Is there a way to check via shell script when an application has been started 100%? And is not still starting?