tisfeng / Easydict

一个简洁优雅的词典翻译 macOS App。开箱即用,支持离线 OCR 识别,支持有道词典,🍎 苹果系统词典,🍎 苹果系统翻译,OpenAI,Gemini,DeepL,Google,Bing,腾讯,百度,阿里,小牛,彩云和火山翻译。A concise and elegant Dictionary and Translator macOS App for looking up words and translating text.
GNU General Public License v3.0
6.89k stars 351 forks source link

"Launch at login" doesn't work #646

Open simonbcn opened 4 weeks ago

simonbcn commented 4 weeks ago

Please confirm the following:

Problem description

When I activate "launch at login" it doesn't really add it to the login items or start it when I reboot the system.

Is the issue consistently reproducible?

Reproducible

Steps to Reproduce

Read problem description

Screenshot

Captura de pantalla 2024-08-16 a las 10 07 11

Runtime log

com.izual.Easydict 2024-08-16--07-54-56-460.log

Expected result

It should add easydict to the login items on macOS.

Proposed solution (optional)

No response

Device type and OS version

Apple M2, macOS 14.5

Are you willing to submit a PR to fix this issue?

tisfeng commented 4 weeks ago

Hello, please check the system settings - Privacy and Security - Automation, and ensure that Easydict has System Events permissions https://github.com/tisfeng/Easydict/issues/625#issuecomment-2260739495 .

If it already exists, try turning it off, then re-enable it, and then reopen the "Launch at login" item in Easydict.

simonbcn commented 3 weeks ago

But this should not be so. Why doesn't it ask for permissions from the application itself when you activate that option?

Jerry23011 commented 3 weeks ago

Because Easydict uses Apple Script with launch at login

https://github.com/tisfeng/Easydict/blob/f18eb571e324dacb6b96ff095248c5e3071ff105/Easydict/Swift/Feature/Configuration/Configuration.swift#L588

But this should not be so. Why doesn't it ask for permissions from the application itself when you activate that option?

This is a good point. Perhaps we can consider using other ways to implement launch at login. @tisfeng

This package works well.

tisfeng commented 3 weeks ago

Thanks for the suggestion, it does need improvement here.

Using AppleScript for launch at login is not a good choice, it was just a solution for https://github.com/tisfeng/Easydict/issues/64 and https://github.com/tisfeng/Easydict/issues/79 .

Since we only support macOS 13+, it's time to switch to SMAppService.

LaunchAtLogin-Modern is a good option, I'll take a look at it later.

tisfeng commented 3 weeks ago

This issue will be fixed in next release.