Create Shortcut/Web Clip on Mac and place in dock

bmichael
New Contributor III

Is there a way to create a Shortcut or Web Clip to a site and place it in the users docks on their MacBooks?

7 REPLIES 7

dsavageED
Contributor III

First off your going to want to have a look at dockutil - https://github.com/kcrawford/dockutil

We then have a script which does this:

#!/bin/sh
# Generate a help and support url file.
HelpURL="/Library/MacSD/Help & Support.url"
echo '[InternetShortcut]' > "$HelpURL"
echo -n 'URL=' >> "$HelpURL"
echo https://www.ed.ac.uk/is/it-help >> "$HelpURL"
# Set a custom icon if you need to
python -c 'import Cocoa; Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(Cocoa.NSImage.alloc().initWithContentsOfFile_("/Applications/Support.app/Contents/Resources/appIcon.icns"), "/Library/MacSD/Help & Support.url", 0)'
# Add to the dock
$DOCK_UTIL --add "$HelpURL" --section others --no-restart $DOCK_PREF

sshort
Valued Contributor

You can use ProfileCreator to set the entire dock, or just target a web clip like you're looking to do. A nice advantage of making a profile in ProfileCreator is you can specify which keys you want set, and just ignore the rest (unlink the Jamf config profile interface)

The screenshot says "cannot be removed from the dock" but that doesn't actually get enforced unless "Prevent modifying items in Dock" is set to TRUE

68353af2647648fd9a019778cd35a5cc

bmichael
New Contributor III

@sshort so when I select the type as URL it will automatically detect the WebClip as the URL?

sshort
Valued Contributor

@bmichael You have to paste the actual URL the webclip is pointing to under the URL field. You'll also need to paste in the file location of the webclip, so that can live in something like /Shared /private/tmp.

bmichael
New Contributor III

Here are a couple screenshots. Im not seeing where I can set the file location of the webclip. I can put /shared/private/tmp in the dock path or home directory but nothing under the webclip part. ed4a5c064b034af49fdb599148d83cb4
702451d2cbc043c4a04e0fe1d061db5a

ryan_ball
Valued Contributor

@bmichael your first screenshot is for a config profile that will only work for iOS devices.

Nix4Life
Valued Contributor

We use Fake