Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Send iMessage text to list of phone numbers.applescript
Created February 23, 2020 17:42
Send an individual text message to each phone number in list.
tell application "Messages"
-- phone numbers must already exist in Contacts
set phoneNumbers to {"6125550000 John Smith", ¬
"6125551111 Mary Poppins", ¬
"6125552222 Larry Bud Melmon"}
-- https://stackoverflow.com/questions/11812184/how-to-send-an-imessage-text-with-applescript-only-in-provided-service
repeat with aNumber in phoneNumbers
set targetService to (1st service whose service type = iMessage)
@talkingmoose
talkingmoose / Download and Install VLC.zsh
Last active October 28, 2025 20:37
Downloads and installs the latest available VLC software directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server. Includes an optional checksum for added security.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/84cbe002aca35c73032bccd230d8988a
@talkingmoose
talkingmoose / Add Keyboard Input Source.sh
Last active December 12, 2021 07:52
This example adds the Latin American keyboard as an input sourcce under System Preferences > Keyboard > Input Sources. Quit and reopen System Preferences if necessary to see the change.
#!/bin/zsh
# adds the additional input source to the list of input sources
/usr/bin/defaults write com.apple.HIToolbox AppleEnabledInputSources -array-add '<dict><key>InputSourceKind</key><string>Keyboard Layout</string><key>KeyboardLayout ID</key><integer>89</integer><key>KeyboardLayout Name</key><string>Latin American</string></dict>'
# enables the input menu in the menu bar
/usr/bin/defaults write com.apple.TextInputMenu visible -bool true
exit 0
@talkingmoose
talkingmoose / Mac software updates.txt
Created February 9, 2020 17:15
For 1:1 devices where administrators need to encourage users to update software or macOS versions.
IT is responsible for patch management, but users should be afforded the opportunity to install updates when convenient for them.
Communication is key. Where possible start with unobtrusive methods to notifiy users they need to install updates such as via email. In the email, include the deadline and a link to a policy to "update now". Use HTML formatting and graphics to help them understand what will happen and make the updates easy.
If email communications fail to get users to update, use a JamfHelper script in a policy to nag users once per day they need to update. Provide a button that links to the policy to "update now" and another button to "remind later". Users should not be able to close the nag until they click either of the buttons. Consider automatically closing the nag after 10 minutes and allowing the policy to reopen it at next checkin. After the user acknowledges the nag by clicking a button, write a time stamp to a file to prevent the nag from appearing the rest of the day. Alternatively, in
@talkingmoose
talkingmoose / Disable Notifications.bash
Last active February 5, 2020 15:29
Under Apple menu > System Preferences > Notifications > Do Not Disturb: Enables Do Not Disturb and sets time range from 7:01 a.m. to 7:00 a.m., effectively disabling macOS Notifications.
#!/bin/bash
# get currently logged in user
currentUser=$( /usr/bin/stat -f "%Su" /dev/console )
echo "Current user is $currentUser."
# set Do No Disturb for the current user to enabled between 7:01 a.m. and 7:00 a.m.
su "$currentUser" -c "defaults write ~/Library/Preferences/ByHost/com.apple.notificationcenterui.plist dndEnd -int 420" # minutes
su "$currentUser" -c "defaults write ~/Library/Preferences/ByHost/com.apple.notificationcenterui.plist dndStart -int 421" # minutes
@talkingmoose
talkingmoose / Mozilla Firefox version number (regex).txt
Last active February 1, 2020 06:23
Match a version or higher
Mozilla Firefox version reference:
https://www.mozilla.org/en-US/firefox/releases/
79.0.3945.117 <— Match or later
Formula:
^[0-9]{3,}.* == Match reference version numbers with three or more digits
@talkingmoose
talkingmoose / Google Chrome version number (regex).txt
Last active February 1, 2020 06:29
Match a version or higher
Google Chrome version reference:
https://developer.chrome.com/apps/manifest/version
79.0.3945.117 <— Match or later
Formula:
^[0-9]{3,}.* == Additional 1 or more digits in first field
@talkingmoose
talkingmoose / Download and install Google Chrome.zsh
Last active April 3, 2024 12:10
Checks version of latest avaialble version of Google Chrome online and compares with locally installed version. Downloads and installs if installed version is older or doesn't exist.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/cc4b1d143bcdf7d6d670ab1b30565694
@talkingmoose
talkingmoose / RenameComputerWithAssetTag.bash
Created December 9, 2019 18:08
Renames Computer Name, Local Host Name and Host Name to format "mac55545lt".
#!/bin/bash
## Rename Mac to format similar to "mac55545lt"
## Written by William Smith, Jamf Professional Services
## December 9, 2019
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="API-Editor"
password="P@55w0rd"
@talkingmoose
talkingmoose / High Sierra-compatible Macs (regex).txt
Last active August 23, 2023 14:12
Regex looks for all Mac models compatible with High Sierra. May include newer models that don't support High Sierra.
Model information: https://support.apple.com/kb/sp765
Published Date: September 12, 2018
(MacBookAir[3-8]|MacBookPro([7-9]|1[0-6])|MacPro[5-6]|iMac1[3-9]?|MacBook(10|[6-9])|Macmini[4-8]),\d
pattern matches:
https://support.apple.com/en-us/HT201608