Pregunta

In El Capitan how can I get an applescript to make itself open at login? Such as adding it to the login items automatically?

I want to be able to send people the applescript and the first time they open it, it automatically sets itself to open at login in future.

If applescript is too limiting I don't mind using a cocoa applescript in Xcode, although I would like to avoid it.

¿Fue útil?

Solución

Add it to the login items (like you mentioned.) Note that (to accomplish this easily) you have to save it as an application bundle.

Using this guide, you can automate the process.

tell application "System Events"
    -- Adding a login item for the current user
    make new login item at end of login items with properties {path:"/Applications/**{YOUR APP HERE}**", hidden:false}
end tell`
Licenciado bajo: CC-BY-SA con atribución
No afiliado a apple.stackexchange
scroll top