Yukie Suraki Yukie Suraki - 3 years ago 258
AppleScript Question

Close all active applications

i can close document with AppleScript,like:

tell application "Numbers"
close every document without saving
end tell

How to do it with in an alternative way of swift?

dfd dfd
Answer Source

I don't think you can do it - at least via a pure Swift solution. Swift is a language, and an open source one at that. It now is run on servers and on Linux-based machines. In the Apple ecosystem, it also can be used on all iOS devices - including Apple TV and Apple Watch.

Closing or shutting down an app is the responsibility of the OS, not a language feature. If you want a way to do it in macOS, you probably are best to write that AppleScript command file and kick it off using Swift.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download