I'm attempting to use the following command in Terminal on MacOS 13.2.1 to add WebDrive.app to my login items hidden (or even just minimized) on MacOS, since there appears to be no way to do it with the new Login items UI under the Settings "General" tab:

/usr/bin/osascript -e ‘tell application “System Events” to make login item at end with properties {path:”/Applications/WebDrive.app”, hidden:true, name:”WebDrive”}’

While I'm not sure this approach would even work if it were syntactically valid, this gives me a 0:1: syntax error: A unknown token can’t go here. (-2740) error. I'm just not seeing what token osascript is complaining about, so any help with this would be very appreciated.

  • I've already seen the proposed solution to avoiding login item windows popping up every time I log in at rootupdate.com and it didn't work for me.
    – chrysanhy
    Feb 26 at 1:21

2 Answers 2


it looks like your code is using smart quotes. This is an autocorrect "feature" in macOS. That would be interpreted as an unknown token if you're copy/pasting it with the smart quotes. If you re-type all of your quotes directly in Terminal, you might get different results. Or you could copy/paste the code from @wch1zpink. They are using standard quotes.

macOS Smart quotes: “System Events” Normal quotes: "System Events"

  • His example, in addition to having smart single-and-double quotes, has mismatched open and close quotes. Mar 8 at 14:48
  • @swaldman Great explanation of what the actual problem was. I should have included that in my post. +1
    – wch1zpink
    Mar 8 at 17:13

This works for me.

/usr/bin/osascript -e 'tell application "System Events" to make new login item at end with properties {name:"WebDrive.app", path:"/Applications/WebDrive.app", kind:"Application", hidden:true}'

You must log in to answer this question.

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