The AppleScript way to quit a Mac application is:
tell application "iTunes"
quit
end tell
How do you quit an app with JavaScript for Automation (JXA)?
The AppleScript way to quit a Mac application is:
tell application "iTunes"
quit
end tell
How do you quit an app with JavaScript for Automation (JXA)?
Quitting an application with JavaScript for Automation is done like this:
var itunes = Application('iTunes');
itunes.quit();
(Note that the Application
call looks inside the /Applications
directory. Any app there can be called by name.)