Skip to content

Blog

Toggle JavaScript and Plugins in Safari

I don’t like to browse the web with JavaScript and Flash and so-on automatically enabled unless I think I need it. A large percentage of ‘web annoyances’ can be avoided simply by turning off JavaScript and plugins unless you really need them. There’s also a security argument to doing this too.

In Firefox, I use NoScript to do this and it works really well. I’ve been using Safari more and more frequently in recent times, however, and I am not aware of a similar solution for the Mac’s default browser.

So I have devised a couple of AppleScripts, which were heavily inspired by and partially derived from the example on this Mac OS X Hints page. They allow me to toggle on and off JavaScript and plugins, respectively (I never have big Java switched on at any time!)

Please note that this is for Safari for Mac OS X only and is designed specifically for the new Snow Leopard Services functionality.

I have created them as Automator Services. The benefit of making them Services is that you can then assign a keyboard shortcut directly to the script and be able to simply press that keyboard shortcut to quickly invoke the script and do the toggle. It’s a lot quicker than hunting through a script menu or launching an application and doesn’t require any third-party software.

System Preferences Keyboard Shortcuts

If you’d like to use these Services, download them below. Once unpacked, drop the files in ~/Library/Services, go to System Preferences > Keyboard > Keyboard Shortcuts, select Services from the list and assign your desired shortcut to the two scripts.

These scripts use Growl to notify you of the toggled state after the script has run. You’ll need Growl installed to make full use of it.

Download the Toggle JavaScript and Plugins scripts (zip archive, 270 KB)

DfontSplitter 0.3 for Mac

DfontSplitter 0.3 for Mac screenshot

I’ve been busy beavering away in Xcode and I am now proud to release version 0.3 of DfontSplitter for Mac.

So, here are the release notes:

New Features and Bugfixes

  • Now supports the splitting and extracting of TrueType Collection (TTC) files in addition to traditional Mac Datafork (dfont) files.
  • The conversion of a .dfont will no longer fail if there is already a TTF of the same name in the same directory; it will now overwrite the existing file.
  • Users of Snow Leopard on Intel Core 2 and Xeon Macs will now be running the DfontSplitter application in 64-bit mode.
  • Improved error message text.

Known Issues

  • Converting TTC files on Mac OS X Leopard (10.5) does sometimes run into problems, where the TTC splitting script can’t open the TTC file. The reason for this is currently unclear.
  • Moving TTF files that have been extracted from a .dfont over to Windows — please see this workaround.

As always, go across to the DfontSplitter project page to download the new release.

If you’re already using DfontSplitter for Mac, simply go to DfontSplitter > Check for Updates within the application to upgrade to the new release.

DfontSplitter 0.2 for Windows

I’ve been sitting on this new version of DfontSplitter 0.2 for Windows until I had a solution to the corrupt font error. With a solution found, I feel ready to offer this improved version of the Windows product.

New DfontSplitter 0.2 for Windows interface

The new release has been rewritten from the ground up in C#, rather than Visual Basic and the interface completely redesigned in Visual Studio 2008. Compared to the previous 0.1 revision, this release has:

  • The ability to convert more than one .dfont at once (batch converting), using a similar interface to the Mac version
  • Runs fondu in a background thread so the user interface does not lock up during a convert operation with lots of files
  • Rudimentary drag and drop support — in most cases you can drag and drop .dfont files from an Explorer window on top of the list box to add them, as well as using the Add Files button.

It’s cleaner, hopefully more stable and brings the Windows feature set roughly in line with that of the Macintosh version. Remember, if you have issues with the TTF files being reported as corrupted, the FontForge workaround will help in almost all cases.

You can download this release from the DfontSplitter project page.

Let me know what you think and feel free to spread the word about this new version to people still using 0.1.

DfontSplitter — Solution to Windows Corrupt Font Error

UPDATE 2011-05-09: While some particularly stubborn fonts do require this process, users who have previously experienced difficulty with older versions of DfontSplitter should first try with DfontSplitter 0.3.1 or later, which include a possible fix for this issue.

I think I’ve finally found a solution to this annoying error message that Windows gives when you use DfontSplitter to convert some fonts and then try and use those converted fonts in Windows.

“The requested font was not a valid font file” error message

It involves using a third-party open source application called FontForge to convert the TTFs that DfontSplitter gives you from a Mac-specific TTF format into ‘regular’ TTF format.

A full tutorial on using this method is included as a YouTube video screencast below.

If you can’t or don’t want to watch the video, essentially the process is:

  • Use DfontSplitter on the .dfont file as normal
  • Open the resulting TTF files you want in FontForge
  • Export each TTF file from FontForge with File > Generate Fonts. Make sure TrueType format is selected.
  • Import the resulting TTF files into Windows fonts folder.

Please do let me know if this process works for you and give any feedback — especially if you’d previously had problems using a .dfont you had wanted to use on Windows.

DfontSplitter for Mac 0.2.1

DfontSplitter logo

I just pushed out an update for DfontSplitter for Mac. The application now features:

  • Automatic software update support via Sparkle
  • New preferences window
  • You can choose whether a Finder window is opened after conversion from the Preferences window
  • New progress indicator while the Convert button is pressed and fondu is working

You can download the release from the (newly prettified) DfontSplitter project page. Enjoy!

SleekTabs 0.2.1 – Bugfix Release

I have just released SleekTabs 0.2.1.

Nothing too exciting, unfortunately, just a bugfix release for a bug which would cause the ajax URLs of a tab not to work if they contained an extra ‘/’ character. This bug was a problem with a regular expression used to append a timestamp variable to the ajax URL (which itself is a fix for a bug with IE caching).

As always, you can download the script from the SleekTabs project page or from its home on PHP Classes.

DfontSplitter 0.2 for Mac

DfontSplitter icon

NOTE: for the latest release of DfontSplitter, please link to https://peter.upfold.org.uk/projects/dfontsplitter.

The software development wheel has been turning again and I can now announce DfontSplitter 0.2 for Mac OS X.

DfontSplitter is a program which allows you to convert, or split, a Mac OS X .dfont font file into one or more TrueType font files (.ttf). TTF files are much more portable than this Mac-specific format.

This new release sports an entirely new interface built in Cocoa. It is a great improvement over the previous AppleScript interface which required a lot of unnecessary clicking and was generally quite horrible. The new interface also supports batch converting; you can drag several dfonts into the sources list and convert them all at once.

To download, please go to the DfontSplitter project page.

The DfontSplitter icon is from the Oxygen Icon set and is licensed under the Creative Commons BY-SA 3.0 Unported licence.

DfontSplitter for Windows Bug – a Vista Workaround

Further to my earlier post on discovering a bug with DfontSplitter for Windows which surfaces on some versions of Windows, I have now discovered a workaround for this issue on Vista.

If you are using DfontSplitter on Vista and when you convert a font, Windows then complains that it is not a valid font file, you can use this workaround to install the font into your Fonts folder. The font should then work normally.

I’ve tested this with a bunch of fonts, but it might not work absolutely everywhere. You’ll just have to try it and see if it helps.

The details of the workaround are listed here, on the dev wiki.

I’m still interested in testers for XP Service Pack 2. If you’d like to help out please get in contact via email or leave a comment below.

Looking for Testers for DfontSplitter for Windows

I have had a bug in DfontSplitter for Windows reported to me, which I have been able to confirm. On at least the following systems, the resulting TTF files that the program converts are reported as corrupted by Windows:

  • Windows XP Professional SP3
  • Windows Vista Business SP1

On my original development system, which was Windows XP Gold (unpatched – and also not connected to the internet), I had no problems.

This issue does not affect the Mac version of the software.

I am looking for anyone with access to Windows XP SP2 (or SP1, or XP Gold) to see if the problem is present there and hopefully from there I can work out if anything can be done, or how to potentially resolve it.

If you can help me out and you run or can run on one of these systems, please let me know by commenting below or email me.

For the time being, I can’t be sure which versions of Windows DfontSplitter will run on correctly. Sorry if you did download it and it didn’t work. 🙁

AppleScript to enable SOCKS proxy on Mac OS X

Find this tutorial useful?





Well, I’m here at Reading University and one of the joys of living here in halls is using the wonderful internet connection, shared with many other download-happy students.

As well as the speed being quite variable, there’s also a greater security risk, especially when transmitting passwords over normal, unencrypted HTTP connections. To solve that problem, I SSH into my server, still sitting back at home and tunnel HTTP traffic through the SSH connection.

This creates a SOCKS proxy server on my local machine and I can push the Mac’s traffic through it. It takes a long time and is fiddly, however, to switch the SOCKS proxy on and off from System Preferences, especially when (as in my special case) you can’t use Leopard’s Locations feature.

The AppleScript applications provided below are a quicker solution. Launch the right app, type your password and the proxy is flipped on or off. Nice and simple and much less fiddly than messing around in System Preferences.

» Read the rest of this post…