Skip to content

Instantly share code, notes, and snippets.

@legraphista
Last active July 30, 2018 11:48
Show Gist options
  • Save legraphista/4d5119f439fe829edbf683355118470e to your computer and use it in GitHub Desktop.
Save legraphista/4d5119f439fe829edbf683355118470e to your computer and use it in GitHub Desktop.
Prank you MacOs friends with this simple script

Setup

The Whisper Voice

System Preferences -> Accesibility -> Speech -> System Voice:Customize -> Check Whisper-> Ok -> Close SP

Q: Why manually enable it? can't you just make a script?
A: If you want to enable it via AppleScript you can't use "System Events" to tell "System Properties" what to do unless it's allowed by "Assistive app control" which is guarded by the user's password. The other alternative is to download the voice package to /System/Library/Speech/Voices/ but the folder is owned by root with no write permissions and can't do anything without the password.

The Cron Script

curl -o- https://gist.githubusercontent.com/legraphista/4d5119f439fe829edbf683355118470e/raw/say.sh | bash

or

curl -L -o- https://goo.gl/YzGAFH | bash
cd ~;
mkdir -p .say; cd .say;
touch hello.sh;
chmod +x hello.sh;
FILE="$(pwd)/hello.sh"
(crontab -l 2>/dev/null; echo "*/5 * * * * $FILE > /dev/null 2>&1 || true") | crontab -
echo '
WORDS=("please help me" "i am so alone" "i am lonely" "pssssst" "hello" "hey, listen.");
say "${WORDS[$[ $[ RANDOM % ${#WORDS[@]} ]]]}" -v Whisper;
' >> hello.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment