Writing a default mail handler

I’m trying to use an applescript as my default mail application:


on open location thing
	set str to thing as string
	do shell script ("emacsclient -e '(compose-mail "" & str & "")'")
	display dialog ("sent mail to " & str)
	quit
end open location

I save it as an application bundle in Script Editor, then change its creator code in both foo.app/Contents/Info.plist and foo.app/Contents/Resources/foo.rsrc to “EMEM” (which is free) from “aplt”. Finally, I add “mailto” as a URL type to Info.plist:


	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLName</key>
			<string>Email Address URL</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>mailto</string>
			</array>
			<key>LSIsAppleDefaultForScheme</key>
			<true/>
		</dict>
	</array>

However, when I set it as the default mail handler in Mail.app, then click on a mailto URL, the finder launches “Mimic PC Monitor”, a random script I didn’t even know existed. What’s going on here? Shouldn’t this be possible?