Launch app when another app is closed

How do I have a specific app open when another app is closed automatically?


I am using Moneydance which quits when clicking the upper left red window button (unlike other apps that have to be quit). The other app is Safari.


Safari will never be running when Moneydance is running as I have it quit via an AppleScript when launching Moneydance, so it's "just" a matter of launching Safari when Moneydance is closed with its red close window button which quits the app.


Is the an AppleScript way to accomplish this?


Thanks



iMac (2017 – 2020)

Posted on Aug 10, 2023 1:58 PM

Reply
32 replies

Aug 19, 2023 5:39 PM in response to Barney-15E

Not sure I follow. I changed the script to the one below and ran as an AppleScript, got error below


tell application "Finder"

set AppList : {“MoneyDance”, “TextEdit”}

set runningApps to name of application processes as list

set ejectDisk to true

repeat with anApp in AppList

if runningApps contains anApp then set ejectDisk to false

end repeat

if ejectDisk then

if exists disk "tom" then eject disk "tom"

end if

end tell


Got syntax error when running the script




Aug 19, 2023 11:12 PM in response to Barney-15E

Just would like to know if this is correct per your suggestion, as it does not run as an AppleScript or as AppleScript within Shortcuts.

Thanks


tell application "Finder"

set AppList to {“MoneyDance”, “TextEdit”}

set runningApps to name of application processes as list

set ejectDisk to true

repeat with anApp in AppList

if runningApps contains anApp then set ejectDisk to false

end repeat

if ejectDisk then

if exists disk "tom" then eject disk "tom"

end if

end tell



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Launch app when another app is closed

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.