October 13th, 2003

HTML Validation AppleScript

Posted in AppleScript by Diggory
SafariScriptMenu.jpg Paste this into Script Editor:

tell application “Safari”
set frontURL to the URL of the front document
end tell

set newURL to “http://validator.w3.org/check?uri=” & frontURL

tell application “Safari”
set the URL of the front document to newURL
end tell

and then save it as a compiled script, drop it into ~/Library/Scripts/Applications/Safari/

If you have the Script Menu installed [/Applications/AppleScript/Script Menu.menu] then, whenever Safari is the front application, the script menu contains an option to validate the HTML of the front web page.
n.b. this will only work for pages that are on a public web-server - it can’t validate local HTML that is not published.

Both comments and pings are currently closed. RSS 2.0

Comments are closed!