Trevor's AppleScript Scripts

 

Remove Duplicate Alarms

Version 1.1

Removes duplicate alarms from iCal.

Version History

  • 1.1: expanded duplicate checking to include two sound alarms that have the same trigger
  • 1.0: initial release

Download


Remove Duplicate Emails

Version 1.0

Removes duplicate email entries from Address Book contacts.

Version History

  • 1.0: initial release

Download


Remove Emails for Label

Version 1.0

Removes all email entries from Address Book contacts whose label matches a given value.

Version History

  • 1.0: initial release

Download


Find Invalid Address Book Fields

Version 1.0

Finds and displays all invalid fields in the Address Book. (Invalid, in this case, is a loose definition: Only a few basic checks are performed, such as whether an email address contains a space.)

Version History

  • 1.0: initial release

Download


Remove Duplicate Addresses

Version 1.1

Removes duplicate addresses from Address Book contacts.

Version History

  • 1.1: Newline characters are now ignored when comparing addresses for uniqueness (thanks to Ron Regev for the patch!)
  • 1.0: initial release

Download


Remove Duplicate Phone Numbers

Version 1.1

Removes duplicate phone numbers from Address Book contacts.

Version History

  • 1.1: ignores formatting so that numbers differing only by spaces or symbols are considered duplicates (thanks to Jeff Fischer for the patch!)
  • 1.0: initial release

Download


Eject Local Drives

Version 1.1

Ejects all local drives (e.g., FireWire, USB), including optical discs.

Version History

  • 1.1: Finder automation is now used (instead of the shell) for better reliability; list of drives to unmount no longer needed
  • 1.0: initial release

Download


Eject Remote Drives

Version 1.1

Ejects all remote drives (e.g., NFS, AFP).

Version History

  • 1.1: Finder automation is now used (instead of the shell) for better reliability; list of drives to unmount no longer needed
  • 1.0: initial release

Download


Apply iTunes Song Ratings

Version 1.0

This script takes as input a Music.txt file created with iTunes' File > Export command. It then applies the song ratings found in this file to the same songs in the current iTunes library. The song name, artist, and album must match; otherwise, the rating will not be affected. If they do match, the current rating will be replaced.

Version History

  • 1.0: initial release

Download


Create Calling Card Phone Numbers

Version 1.0

Unlike other cell phones, the iPhone does not have the ability to automatically use a stored calling card access number when dialing international phone numbers. As a workaround, this script searches for contacts that have international phone numbers and adds a secondary number to the contact. This secondary number, labeled with the name of the calling card company, dials using the calling card instead of dialing directly.

Note that the script does not replace or delete the old number, ensuring that Caller ID still works if your contact calls you.

Before running this script, you will first need to edit the variables foreign_country_code, calling_card_company, and calling_card_prefix according to your particular situation. The script will only affect numbers that begin with a + followed by the foreign_country_code you specify.

If at some point you add new contacts and want to apply the script to them, simply re-run the script. This is safe as long as you haven't changed any of the calling card settings. If, however, you need to change the calling card settings or simply want to undo the changes, you will need to run the Remove Calling Card Phone Numbers script (see below).

This script was inspired by a similar script found on Mac OS X Hints.

Version History

  • 1.0: initial release

Download


Remove Calling Card Phone Numbers

Version 1.0

This script reverts the changes made by the Create Calling Card Phone Numbers script (see above). Before running this script, you will need to edit the calling_card_company variable so that it matches the same variable used in the Create Calling Card Phone Numbers script.

Version History

  • 1.0: initial release

Download


Remove Duplicate Events

John Maisey has written some helpful scripts to remove duplicate iCal events, remove to-do alarms that have no due date, and more. You can find them here.






Did you find these scripts useful?