Transmission does not support AppleScript specifically, so there is no way to use AppleScript to check if downloads are still active or not.
There's a concurrent discussion of this idea going on at
https://forum.keyboardmaestro.com/t/applescript-for-transmission-app/15789 but this is probably a better place for it, so I'll summarize my answer from there.
brew info transmission-cli
Enable the "Remote" feature of Transmission app:
You do not have to limit to
127.0.0.1 but unless you need to access from another computer, there's no harm in leaving that on.
- Enable the feature to remove torrent from the Transmission list after seeding is done:
- Now you can run this script periodically:
#!/usr/bin/env zsh -f
# the `pgrep` line says 'If Transmission is not running, exit immediately
# just in case the script happens to be run when the app isn't even running
pgrep -qx Transmission || exit 0
`STATUS=$(transmission-remote --list | egrep -v '^(ID|Sum:) ')`
if [[ "$STATUS" == "" ]]
osascript -e 'tell application "Transmission" to quit'
echo "Transmission is still active:\n$STATUS"
If Transmission is running, but there are no items in the list, it will be quit.
There may be other ways of doing this, but I cannot think of any myself (other than just using Transmission's preference to run a script when a download is complete, and quitting the app then, but that will fail if there are multiple concurrent downloads active).