Bookmarklet to fix AppleScript pasting on discussions.apple.com
The editing tools on discussions.apple.com cause a direct paste from AppleScript Editor to have a negative indent.
This causes posts to appear misaligned, fixing the text normally requires manual HTML editing via the advanced editor.
After helping user 't quinn' to work through removing this negative indent via an AppleScript I decided to make a bookmarklet to make the process simpler.
The result is hosted at http://marklets.com/De-indent.aspx
Setup
Drag the large De-Indent icon into your bookmarks bar
Usage
Click the bookmark when editing a post with mis-aligned AppleScript, the bookmarklet will alter the indentation.
Read the FAQ on Marklets.com if you need generic help with bookmarklets, the source is available there too.
Original discussion
Re: Using Applescript to replace negative indent in HTML
Thanks to t quinn & Hiroto for the idea.
For reference, here is the current source.
javascript: (function() {
var mceFrame = document.getElementById('wysiwygtext1_ifr');
var content = mceFrame.contentWindow.document.body.innerHTML;
var newcontent = content.replace(/text-indent:-/g, 'text-indent:');
mceFrame.contentWindow.document.body.innerHTML = newcontent
})()