Jump to content

Alfred wont close all the apps in applescript but running it multiple times work


Recommended Posts

on alfred_script(q)
  tell application "Slack" to quit
  tell application "Notion" to quit
tell application "Webstorm" to quit
tell application "Postman" to quit
tell application "Postico" to quit
tell application "Tower" to quit
tell application "Microsoft Teams" to quit
tell application "Microsoft Excel" to quit
tell application "Termius" to quit
tell application "Intellij IDEA" to quit
end alfred_script

 

I have that script in alfred. The earlier ones get run but the latest ones fail. But if I run the script multiple times it eventually closes everything. 

 

Any ideas?

Link to comment
On 5/1/2023 at 8:13 PM, vitor said:

on alfred_script(q) is only relevant with a Run NSAppleScript, and you should avoid it unless you specifically need it in favour of a Run Script with /usr/bin/osasscript (AppleScript) as the language. But you can also use the macOS → Quit Apps Automation Task.

 

I changed it to /usr/bin/osasscript (AppleScript), same thing 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...