문제

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.

도움이 되었습니까?

해결책

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`
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 apple.stackexchange
scroll top