Applescript Prank to Make Your Victims Punch Babies in the Face

This is a prank that takes a little while to set up, but only a few seconds to execute. It has caused hysteria many-a-time for me, as it will likely also do for you.

What it will do:

This prank script will blare a song of your choice at the max volume on your victim’s Mac, and they will not be able to turn the volume down. It also sets itself as a login item so that even if the victim reboots, it will not stop their dilemma.

Feeling evil yet?

If you don’t want to go through this tutorial, and all you want is a working prank, you can download it here.

You will need:

  1. A Mac running OS X 10.4 or higher (Your victim will also need a Mac.)
  2. A USB stick
  3. A fantastic MP3 clip which you think your victim would love to listen to.
  4. (Rick Astley’s “Never Gonna Give You Up” is used in this example.)

Firstly, open up Applescript Editor. This should be found in your Applications/Utilities/ folder. You will need to do a bit of writing script, but Applescript is quite possibly the easiest scripting language to write on the face of the earth as of right now, and you can mostly just copy/paste the code I will include in this tutorial.

Code for your first script

Paste this into the Applescript Editor window:

set this to POSIX path of (path to me)
set vol to quoted form of (POSIX path of (path to me)) & “Contents/Resources/vol.app”
set song to quoted form of (POSIX path of (path to me)) & “Contents/Resources/song.mp3″
tell application “System Events” to make new login item with properties {path:this, hidden:true} at end
delay 30
repeat
do shell script (“open ” & vol)
do shell script (“afplay ” & song & ” > /dev/null 2>&1&”)
delay 214
end repeat

Hit the “Compile” button to make sure everything is alright.

It should look like this afterwards:

Screenshot of script window

This script will basically do four things:

  1. Set the script to start at login.
  2. Delay the entire script for 30 seconds, so that you have time to run away before the shit hits the fan.
  3. Start a script which turns the volume all the way up. (The code for this script comes later)
  4. Start playing the song of your choice.
  5. Delay the script for 214 seconds. This is something you will have to adjust depending on the length of your song. “Never Gonna Give You Up” is 214 seconds long, therefore the script must stop for 214 seconds. (Make sure that you change this to fit your song, otherwise it will not work correctly!)

Save the script as an Application. You will have the option to select this in the drop down menu after clicking “Save As” under “File”.

Make sure to save it as “lol.app” unless you decide to change the code.

File dialog

 

Code for your second script

Insert this into your Applescript Editor window:

repeat
set volume 7
delay 0.1
end repeat

This will set the volume to the max (7), and repeat it every 0.1 seconds forever.

Hit compile, then save this script as an Application just as you did for the previous one, except make sure to save it as “vol.app”!

Getting the bundle ready

At this point, you will need to have chosen your audio file to play. Rename it to “song.mp3″ then follow these steps:

  1. Open up your first script in Applescript Editor.
  2. Click on the “Bundle Contents” button. A sidebar should pop out showing a few files.
  3. Now drag “song.mp3″ and “vol.app” into the sidebar, so that it looks something like this:

Sidebar

Once this is done, go to “File” and click “Save”. Not “Save As”!

Your script should now be fully functional, however there is one thing you should notice. It shows up in the dock! This makes it easy for your victim to quit the two scripts, and alleviate their pain!

We want their suffering to last for as long as possible, so we are going to fix this with an application called Dockless. You can download Dockless here.

Once you have it, mount the .dmg file and drag Dockless out of it. Open it. It may take a few minutes to open on the first time.

Once it is open, click on the “Simple” tab.

Dockless

Drag your first script into the window. Click on the image, and it should say that it will no longer appear in the dock.

You will also have to do the same for your second script, but it is already inside of your first script. To get to it, right click on your first script and select “Show Package Contents”.

Show package contents

Once the Finder window pops up, open the “Contents” folder, then “Resources”. You should see “vol.app” in this folder.

Drag “vol.app” into the Dockless window, and click it just as before. When it says that it will no longer appear in the dock, you’re finished with the scripts! Open your first script to test it! The two scripts will NOT show up in the dock, or under the Force Quit dialog.

If you can’t figure out how to quit it, open up Activity Monitor and quit these three processes: lol, vol, and afplay.

I would strongly advise compressing the script into a .zip file and saving it somewhere as a backup, as for some reason it can become corrupted and stop working once in a while.

Planting it on the victim’s computer

  1. Put the script on a USB stick.
  2. Plug the USB stick into their computer.
  3. Drag the script to some obscure folder on their hard drive. I usually use the “Colorpickers” folder inside of their “Library” folder.
  4. Open the script. You will have 30 seconds to leave the area before it starts blaring the song.

That’s it! Good luck!

Up And Running

Haxx'd.Soon I will be posting tutorials on various Mac related things, such as useful terminal commands, enabling a new administrator account, and bypassing web-blocks.

This should be interesting.