I want to delete a login item via an osascript bash script. I know how to do that if I know the name of the login item. But I would like to be able to say "delete all login items that are mounted volumes" and I haven't been able to find the syntax to accomplish that. My goal is to remove any shares that are mounted via login item, as I intend to replace them with a script to handle automounts. (I would prefer to manage automounts that way instead of using configuration profiles.)
So far, the command I've tried is:
osascript -e 'tell application "System Events" to delete login items with properties { kind:volume }'
The error I get is:
71:72: syntax error: Expected “given”, “with”, “without”, other parameter name, etc. but found “{”. (-2741)
Has anyone else encountered this?
And is what I am trying to do even possible?
Question
Deleting all login items with a particular property...
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
