Tag Archives: highlight

Reset Mac OS X Dictionary

I’m heavily reliant on the Mac OS X spell checker, but I sometimes click Add to Dictionary instead of the correct spelling. For obvious reasons, that isn’t good, so it’s helpful to know where those new words are stored. Here’s an example:

Screen Shot 2016-09-01 at 10.22.04 PM

You can view the custom dictionary by opening Finder and navigating to:

Users/USER_NAME/Library/Spelling/

In that directory, you’ll see an en file and a LocalDictionary file. You can open each of those files with the TextEdit.app and view the words that were added to the dictionary. Embarrassingly, my Local Dictionary file currently looks like this:

Screen Shot 2016-09-01 at 10.33.01 PM

Delete any unwanted words and save the file. The changes will take effect once you reboot.

Current as of Mac OS X 10.11.6 (El Capitan)

AppleScript – Executing JavaScript in Safari and Chrome

I haven’t used AppleScript much, but I was recently working on a script to automate a workflow and I was surprised to discover that each browser uses different commands to execute JavaScript.

Specifically, Safari uses do JavaScript "add code here" in document X and Chrome requires execute javascript "add code here"

Here’s an example of each:

Safari

tell application "Safari"
	open location "https://google.com"
	if (do JavaScript "document.readyState" in document 1) is "complete" then set pageLoaded to true
	display dialog pageLoaded as string
end tell

Google

tell application "Google Chrome"
     open location "https://google.com"
     if (execute javascript "document.readyState") is "complete" then set pageLoaded to true
     display dialog pageLoaded as string
end tell

A couple notes:

  1. AppleScript.app autocorrects the second example to a lowercase JavaScript, but either should work.
  2. Safari requires that a document is specified
  3. If you’re using Firefox, it’s currently not possible to execute JavaScript with AppleScript

Removing Game Center from OS X Yosemite

October 16, 2015 Update: If you’re running OS X 10.11 (El Capitan), you’ll need to disable the System Integrity Protection functionality if you want to hide or remove Game Center.

One of the first things I noticed when looking around OS X 10.10 (Yosemite) was the Game Center icon in the Applications folder.

Game Center has been in Mac OS X since 10.8 (Mountain Lion), but the icon recently changed to match the bubbly iOS icon:

Screen Shot 2014-10-20 at 10.30.59 PM

I never really use Game Center on iOS and am always annoyed with the spammy friend requests. I’ve turned off Game Center friend requests multiple times, but it always seems to get turned back on.

Once I saw Game Center in Yosemite, I immediately tried to drag the icon to the Trash. No luck:

Screen Shot 2014-10-16 at 9.08.37 PM

It took a couple minutes, but I figured out how to remove it. Here’s how your remove Game Center:

Warning! Don’t do this unless you’re comfortable with the command line and have a recent backup of your hard drive. If you don’t know what sudo means, then please don’t proceed. A simple mistake with sudo rm could cause major issues.

– Open Terminal
– Navigate to the Applications folder
– Enter the following:

sudo rm -rf "Game Center.app"

That’s it!

After removing Game Center, I restarted my computer. Game Center didn’t reappear and everything is seems fine. So far. There are probably some ramifications if you try to play Mac App Store games that support Game Center, but I’m not sure. And now I’m wondering if Game Center will reappear then next time I update OS X. Regardless, it’s nice to be rid of that extraneous icon 🙂

Otherwise, I really like Yosemite. It’s really snappy (on a wiped 2012 MacBook Air).