Skip to main content
Answer

Dockutil Command w/o Separate Script

  • August 1, 2017
  • 2 replies
  • 27 views

Forum|alt.badge.img+6

Hello!

I'm trying to find a solution for attaching Dockutil commands to a policy. I want to embed the command within the policy, instead of creating a separate script for just adding one icon to the dock. I expected to be able to make a one-banger command on a per-Application basis through Files and Processes > Execute Command within the policy options, but I haven't yet been successful.

Here's what I'm throwing in now. I don't know how the syntax compares to creating a bash script. I think my hangup revolves around the command running as Sudo, instead of the current user.

/usr/local/bin/dockutil --add /Applications/DaVinci Resolve/DaVinci Resolve.app --before 'Fusion' "/Users/$3"

Fomr the logs...

Running command /usr/local/bin/dockutil --add /Applications/DaVinci Resolve/DaVinci Resolve.app --before 'Fusion' "/Users/$3"... Result of command: /Users/Library/Preferences/com.apple.dock.plist does not seem to be a home directory or a dock plist

Right now I'm just testing this with an ongoing policy triggered by Self Service. The application I'm deploying (DaVinci) takes too long for this to reasonably be deployed as a login item, so I think I'll ultimately set it to recurring/once per user. That way, they'll already be logged in when it runs.

Any recommendations?

Best answer by ChickenDenders

Right after I posted this, I changed the last bit of the command and got it working :)

.....  --before 'Fusion' "/Users/$3"

changed to

..... --before 'Fusion' --allhomes

2 replies

Forum|alt.badge.img+6
  • Author
  • Contributor
  • Answer
  • August 1, 2017

Right after I posted this, I changed the last bit of the command and got it working :)

.....  --before 'Fusion' "/Users/$3"

changed to

..... --before 'Fusion' --allhomes

Forum|alt.badge.img+6
  • Author
  • Contributor
  • August 1, 2017

[deleted double post]