2

I usually have multiple windows requiring to close before sleeping. (all the contents are saved already)

I attempt to accomplish it in terminal so I can encapsulate commands to some script.

I tried:

$ close -a atom
-bash: close: command not found
$ close -a Opera
-bash: close: command not found

How to solve the problem?

  • Why do the windows need to close? – Mark Nov 16 '17 at 2:02
  • I have no idea what that comment means – Mark Nov 16 '17 at 2:26
  • close them let me comfortable to sleep @Mark – Algebra Nov 16 '17 at 2:31
  • @JoseTronco Still don't understand why you need to use the command line. – JMY1000 Nov 16 '17 at 2:50
4

Use osascript to call an AppleScript from the command line.

Save the following script or one like it somewhere, then run osacript [path to file]:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .