Addigy's Smart Software features provides flexibility for deploying files and apps to your devices. This article provides a workflow for pushing a file to user's desktops that opens a specific URL.
This article will use two WebClips to show different approaches—one with a custom icon and one without.
Table Of Contents
- Creating A WebClip
- Optional - Assigning a Custom Icon to a WebClip
- Deploying WebClip With Default Icon
- Optional - Uploading a WebClip (Custom Icon)
- Optional - Deploying a WebClip (Custom Icon)
Creating A WebClip
To create a WebClip follow these steps:
- Download the "Addigy.webloc" file that is attached to this article.
- Replace the inside of <string>https://www.addigy.com</string> with your URL and rename the file (make sure that the file extension stays .webloc).
Note: If you want to add a custom icon to your WebClip follow the steps below. If you do not want a custom icon proceed to Deploying WebClip With Default Icon.
Optional - Assigning a Custom Icon to a WebClip
Adding a custom icon to a WebClip is not required but can enhance the appearance of the WebClip on the user's desktop. To add a custom icon follow these steps:
Download the desired icon in a supported format (.png, .jpeg, or .icns).
Open the "Get Info" window of the WebClip you created.
-
Drag the icon onto the preview image in the "Get Info" window as shown in the screenshot below.
If done successfully the new icon will appear as the icon of the WebClip.
Deploying WebClip With Default Icon
- Create a Smart Software payload and upload the .webloc file.
- Copy the provided scripts into the Smart Software item.
- Update the Addigy.webloc in line 7 (filename="Addigy.webloc") to match the name of your .webloc file.
Installation script:
#!/bin/bash
# Get the working directory
current_path=$(pwd)
# File name and icon
filename="Addigy.webloc"
# Source path
source_path_filename="$current_path/$filename"
# Starting script process
echo "Starting script..."
# Check if the source file exists
if [ ! -e "$source_path_filename" ]; then
echo "Source file does not exist: $source_path_filename"
exit 1
fi
# Process each user with UID >= 500
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do
echo "Processing user: $user"
userHome=$(dscl . read /Users/$user NFSHomeDirectory | awk '{print $2}')
echo "User home directory: $userHome"
# Check if file already exists on the user's desktop
if [ -e "$userHome/Desktop/$filename" ]; then
echo "File already exists on the desktop for user: $user"
continue
fi
# Check if the desktop directory exists
if [ ! -d "$userHome/Desktop" ]; then
echo "User $user does not have a valid Desktop directory. Skipping."
continue
fi
# Copy file to user's desktop
echo "Copying file to desktop for user: $user"
cp "$source_path_filename" "$userHome/Desktop/$filename"
if [ $? -ne 0 ]; then
echo "Failed to copy file to $userHome/Desktop/$filename for user: $user"
continue
fi
# Set ownership and permissions
echo "Changing ownership and permissions for user: $user"
chown "$user:staff" "$userHome/Desktop/$filename"
chmod 644 "$userHome/Desktop/$filename"
done
echo "Script finished."Script Output:
Conditional script:
#!/bin/bash
filename="Addigy.webloc" # Name of the WebClip file
missingUsers=() # Array to track users missing the file
# Iterate through users with UniqueID >= 500
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do
userHome=$(dscl . read /Users/$user NFSHomeDirectory | awk '{print $2}')
if [[ ! -e "$userHome/Desktop/$filename" ]]; then
echo ""
echo "User '$user' does not have the desktop link: $filename"
missingUsers+=("$user")
fi
done
# Report results
if [[ ${#missingUsers[@]} -gt 0 ]]; then
echo ""
echo "The following users do not have the $filename file:"
printf '%s\n' "${missingUsers[@]}"
exit 1
else
echo "All users have the $filename file."
exit 0
fiThe condition is considered a custom condition that does not take into account the exit status of 0 as the default return. You would need to uncheck this:
Condition Output:
After looping through all users:
- If the
missingUsersarray contains any entries:- It lists all users missing the file and exits with a status code of
1(indicating failure).
- It lists all users missing the file and exits with a status code of
- If no users are missing the file, it outputs a success message and exits with a status code of
0(indicating success).
Final Output - Desktop:
Optional - Uploading a WebClip (Custom Icon)
To use a custom icon that Addigy recognizes it is necessary to upload the WebClip with its embedded metadata. Run the following command on your local machine (where the WebClip was originally created) to zip the WebClip file while preserving its resource metadata—such as the custom icon—so it remains intact during upload.
ditto -c -k --sequesterRsrc "/Users/youruser/Downloads/YourWebClip.webloc" "/Users/youruser/Desktop/YourWebClip.webloc.zip"
Notes:
Replace
youruser&YourWebClipwith your macOS username and web clip file name.If you changed the location of where you downloaded your WebClip you will need to edit the command to match the path instead of using the downloads directory that is used in this example.
Once executed the zip file will now appear in your desktop with its context as shown below:
Upload the .zip to Addigy via the File Manager which can be found in the top-right corner of the Catalog:
Optional - Deploying a WebClip (Custom Icon)
The WebClip with a custom icon is deployed the same way as the default one—the only difference is using a new extraction method to preserve the icon metadata from the ZIP file.
Note: PizzaTime.webloc is used here as a test WebClip. Be sure to update the WebClip & FileName variables in the script to reflect your own .zip file and WebClip.
#!/bin/bash
current_path=$(pwd)
FileName="PizzaTime.webloc.zip"
WebClip="PizzaTime.webloc"
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do
userHome=$(dscl . read /Users/$user NFSHomeDirectory | awk '{print $2}')
userDesktop="$userHome/Desktop"
webclipPath="$userDesktop/$WebClip"
if [ ! -d "$userDesktop" ]; then
echo ""
echo "Skipping $user: No Desktop folder found"
continue
fi
if [ -e "$webclipPath" ]; then
echo ""
echo "✅ WebClip found found for $user"
continue
else
echo ""
echo "❌ WebClip not found on $user desktop - INSTALLING..."
# Unzipping with ditto to keep the metadata and attaching it to the desktop
if ditto -x -k "$current_path/$FileName" "$userDesktop"; then
echo "✅ Extraction succeeded."
else
echo "❌ Extraction failed."
continue
fi
# Confirming the permission of the webclip
echo "Confirming the permission of the webclip..."
chown -R "$user":staff "$userDesktop/$WebClip"
chmod -R 644 "$userDesktop/$WebClip"
## FINAL CHECK ##
if [ -e "$webclipPath" ]; then
echo "✅ WebClip found for $user"
else
echo "❌ WebClip not found on $user desktop."
fi
fi
done
Conditional script:
#!/bin/bash
WebClip="PizzaTime.webloc"
missingUsers=() # Array to store users missing the file
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do
userHome=$(dscl . read /Users/$user NFSHomeDirectory | awk '{print $2}')
userDesktop="$userHome/Desktop"
webclipPath="$userDesktop/$WebClip"
if [ ! -d "$userDesktop" ]; then
echo ""
echo "Skipping $user: No Desktop folder found"
continue
fi
if [ -e "$webclipPath" ]; then
echo ""
echo "✅ WebClip found for $user"
else
echo ""
echo "❌ WebClip not found on $user"
missingUsers+=("$user") # Add user to the missing list
fi
done
# Check if any users were missing the file
if [[ ${#missingUsers[@]} -gt 0 ]]; then
echo ""
echo "The following users do not have the ${filename} file:"
printf '%s\n' "${missingUsers[@]}"
exit 1
else
echo "All users have the ${filename} file."
exit 0
fi
The condition is considered a custom condition that does not take into account the exit status of 0 as the default return. You would need to uncheck this:
Condition Output:
After looping through all users:
- If the
missingUsersarray contains any entries:- It lists all users missing the file and exits with a status code of
1(indicating failure).
- It lists all users missing the file and exits with a status code of
- If no users are missing the file, it outputs a success message and exits with a status code of
0(indicating success).