1

Found the following Can Login Items be added via the command line in High Sierra?

which I'm trying to adapt to add a login item in 10.14.6

I realize that it's a somewhat old thread by now, but I've been trying with the following, in 10.14.6, adapted from the solved in thread linked above:

osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/cDock.app/Contents/Resources/cDock\ Helper.app", hidden:false}'

But keep getting the following error:

syntax error: Expected “"” but found unknown token. (-2741)

Can someone perhaps suggest how to rewrite this to avoid the error?

  • Knew that somewhere in the back of my head, but had forgotten all about it. That did the job, thanks! – VB23 Nov 16 '19 at 18:03
2

You need to remove the backslash (\) from: cDock\ Helper.app

You do not need to escape spaces in a path filename when it is in quotes.

Only escape spaces in a path filename when it is not in quotes.

Never do both, (in this use case).

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .