I have two versions of firefox. One has an application name "Firefox" and the other is called "Firefox 2".
I'd like to tell AppleScript to close both instances of Firefox. Here's my code
tell application "Firefox" to quit
tell application "Firefox 2" to quit
It's weird because I can type this into Script Editor, but when I press save it always turns into this.
tell application "Firefox" to quit
tell application "Firefox" to quit
I ran this code and I'll put the output below.
tell application "System Events"
set theVisibleApps to (name of application processes where visible is true)
end tell
{"Finder", "Terminal", "Script Editor", "firefox", "firefox"}
And here's the error code: error "Firefox got an error: Connection is invalid." number -609
How do I make sure they both close?