Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Quit Spark

I am using an automator script that includes Quit All Apps. I recently added Spark as an email client, which frequently, but not always shows the following window before quitting.


This winds up interfering with the Quit All Apps. Is there a way that a script could click quit IF this alert window appears and still proceed quitting all other apps?

Running Catalina.

Thanks

MacBook Pro 13", macOS 10.15

Posted on Jan 21, 2020 8:00 AM

Reply
Question marked as Best reply

Posted on Jan 21, 2020 8:18 AM

AppleScript is not multi-threaded, and events occur in sequential fashion — just like Automator workflows. Thus one cannot test for the presence of a dialog, as the script is waiting for the dialog to be dismissed by the user before script continuance. I don't use Spark. Check if there is a scripting dictionary for it (Script Editor : Open Dictionary… : Spark) and assess if there is anything that would allow you to force the Spark synchronication process where it is needed before the workflow encounters Quit All Apps.

6 replies
Question marked as Best reply

Jan 21, 2020 8:18 AM in response to APPLEAL

AppleScript is not multi-threaded, and events occur in sequential fashion — just like Automator workflows. Thus one cannot test for the presence of a dialog, as the script is waiting for the dialog to be dismissed by the user before script continuance. I don't use Spark. Check if there is a scripting dictionary for it (Script Editor : Open Dictionary… : Spark) and assess if there is anything that would allow you to force the Spark synchronication process where it is needed before the workflow encounters Quit All Apps.

Jan 22, 2020 4:33 AM in response to APPLEAL

By default, killall(1) sends a software termination signal (SIGTERM or -15) to the named application. If the application is well written, it will capture that signal, take the proper steps to perform internal house-keeping, and then quit gracefully. If there is network activity ongoing when it receives SIGTERM, it may take some time to close those down. I suggest that you follow your default killall command with:


sleep 15


which will suspend processing after the killall command by 15 seconds before it moves on to the next action. On other platforms the sleep command will take s, m, h, and other modifiers after the value for different time measures, but not on macOS.


Spark might also intercept and ignore a SIGTERM. In that case, you would have to specify stronger medicine (SIGKILL or -9) which could cause it to quit ungracefully (abruptly) with potential mail corruption.


In either case,

Quit Spark

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.