Safari Shortcut To Desktop?

New Contributor II

Hi Chaps,

Trying to create a DMG file to deploy that will install a safari shortcut to everyones desktop. Or possibly in the Applications folder, when I open composer and drag the Icon from my desktop in, it creates the folder


Obviously not everyone will have a "Simon" user folder and I want it to go to theres, is there something like $username or something that will work and edit the folder named Simon?



New Contributor II

Would this work?d7731d4c886644c2837bd32aaea75658

Contributor III

If you create a DMG as shown with Users>Simon>Desktop>GreyConnect.webloc and:

Deploy without FEU/FUT checked, you will get this on the target computer:


Deploy with FEU (Fill Existing Users) checked, you will get this on the target computer:


(installed in the Desktop folder for every user)

Deploy with FUT (Fill User Templates) checked, you will get this on the target computer:

"/System/Library/User Template/*/Desktop/GreyConnect.webloc"

(installed in all of the User templates, so any new user that logs in to the machine will get it)

So the username in the composer package doesn't really matter, though when I do those packages I like to use a generic "packaging" account. You can use FEU and FUT simultaneously if you want.

There is another option, using a package (PKG) that contains the file and a script to copy the files where they need to go in the user's directories.

Legendary Contributor II

There's also going the completely scripted way, though this would only work for the logged in user and not on a global level for any future accounts.


loggedInUser=$(stat -f%Su /dev/console)
loggedInUID=$(id -u "$loggedInUser")

/bin/launchctl asuser "$loggedInUID" sudo -iu "$loggedInUser" "/usr/bin/osascript << EOF
tell application "Finder"
set mySource to POSIX file "/Applications/" as alias
make new alias to mySource at desktop
set name of result to "Safari"
end tell

Honored Contributor III
Honored Contributor III

@betty02 Create the DMG under an account that exists in the Macs, something like ladmin.

Casper will ASR to that location, then copy out to the other users homes.

Valued Contributor

We chose to put specific school related sites in their Dock instead of the Desktop.

You can use an AppleScript for this, export it as an app, put in your Applications folder, package, then push to users' Dock.


New Contributor III

With FEU/FUT, do you need to run a package at reboot, when including it during imaging? I noticed that with FEU/FUT, it was still putting /user/pmcgurn/Desktop/file in the imaged Mac.

Valued Contributor II

Like @mm2270 I would consider doing this with a script. A script makes it easy to make changes or remove the shortcut in the future.

The following as a login script should accomplish the task.


echo [InternetShortcut] > /Users/$3/Desktop/Test.url
echo URL= >> /Users/$3/Desktop/Test.url
chown $3 /Users/$3/Desktop/Test.url

New Contributor

The script works great, I was wondering if there was a way to change the icon as well in the script?


Just wondering if anyone did figure out how to change the icon on the desktop to a specific image? Trying to get our new 1:1 students set up with a desktop link.

Tried the config profile and with web clips, but they can trash it and be done.


We are using this to adda Icon to URL Files.

Contributor III

@swallace We save the applescript as an application and then just swap out the .icns file (located in the resources folder).