How to run python script at OS X Startup

116 views Asked by At

I have macbook air (M1 chip). Installed: mac os ventura 13.5. I have a python app that displays a timer in taskbar. I use rumps to do that. I want to launch on startup. I tried to do it with:

launchctl load ~/Library/LaunchAgents/com.myapp.start.plist

But nothing. I unload it and tried again, restarted my computer but still nothing.

Here is the code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>my.app</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/me/Desktop/projects/project1/venv/bin/python</string>
        <string>/Users/me/Desktop/projects/project1/app.py</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

Can someone help with that, please?

0

There are 0 answers