Safari Web Site Validator 1.0
Opens a new window in Safari and sends the html or xhtml code of the web page you're viewing to W3C Markup Validation Service. W3C will display any errors it can detect in the html/xhtml code. I included two scripts in the folder. The second script is named 'Safari Web Site Validator Go' and it does the same thing as 'Safari Web Site Validator' except there isn't a dialog box when you launch it. This is convenient (faster) for those of you who have many pages you want to validate on your web site. Universal Binary
published on Thursday, the 29. May 2008, scriptbuilders
View higher quality videos on YouTube
Many people are using a trick to view any YouTube video in high-quality -- simply append &fmt=18 to the end of the URL. This is a job for AppleScript! Here are two simple versions; the first, for for OmniWeb: tell application "OmniWeb" set current_url to the address of active tab of browser 1 set current_url to current_url & "&fmt=18" set the address of active tab of browser 1 to current_url end tell ...and the second, for Safari: tell application "Safari" set current_url to the URL of current tab of window 1 set current_url to current_url & "&fmt=18" set URL of current tab of window 1 to current_url end tell These can be placed in ~/Library » Scripts » Applications » AppName for easy access via the Script menu. [robg adds: Queue user fds suggests that a JavaScript bookmarklet may work better, and it will work in any browser. Create a new bookmark for any site (or a blank ...
published on Friday, the 21. March 2008, macosxhints
Safari 3.1 sees improved form support in latest beta
Apple this month continues to plug away on a small but significant update to its fledgeling Safari web browser, most recently making improvements to the application's handling of web forms and faulty Javascripts. The cross-platform browser update...
published on Tuesday, the 4. March 2008, appleinsider
Fully automated, one-step sending of a URL from Safari
I often send a link off to one single person, many times a day. You can use the Mail Link to this Page feature in Safari, but that still means you have to compose the email with the To address, and also tell the email to send. Since I do this several times a day, I decided to AppleScript it. Drop the following script into ~/Library » Scripts » Safari; name it what you like. If that folder structure is not already made, just make new folders with the correct names. The script will get the current URL of the frontmost document in Safari. It will not copy it to the clipboard, leaving your clipboard in the same state. The script them brings Mail.app forward, addresses an email, sets a subject, some body copy, and drops the URL into the email. Finally, a signature is added to the message, and it is sent out. After that has happened, Mail.app is set to hidden, and Safari is brought back to the foreground where you last left it. Here's the script: ...
published on Friday, the 22. February 2008, macosxhints
Save selected browser text via AppleScript
I occasionally find myself wanting to save some text from a browser window. Usually I want to know where the text came from as well, so just dragging out a text clipping to the desktop is not a good solution. I wrote two AppleScripts (one for Safari and one for Firefox) to make saving a selected text, URL, and page title from browser windows easier. The scripts write the browser's selected text and other info to a text file that it creates on the user's desktop. (I don't like clutter on the desktop, so on my Mac, this file gets created in another folder. However, I wanted to provide example scripts that worked, so I chose the desktop). Below is an example of the script's output with the date, the URL, the page title and some text from a selection: Wednesday, February 6, 2008 8:40:11 PM http://some-url.com Photo of the Day ------------------- A deep-blue sky sets off a mass of yellow wildflower blooms along ... [snip] ... magazine ~~...
published on Friday, the 15. February 2008, macosxhints
10.5: Assign a set of apps to Spaces via AppleScript
This previous hint on using AppleScript with spaces got me to thinking about ways to get two (or more) different sets of spaces. So, for instance, you could have a 'work' Spaces set with Terminal, Safari, Mail, and an RSS Reader, and a 'home' Spaces set with Safari, Mail, GarageBand, and iPhoto.The easieset way I've found to do this is with a couple of AppleScripts that basically look like the following:set spaces_bindings to {|com.apple.terminal|:7, |com.apple.mail|:1, |com.ranchero.netnewswire|:4, |com.apple.iTunes|:65544}tell application "System Eve...
published on Tuesday, the 15. January 2008, macosxhints
Start torrent downloads from an iPhone
I have a server that I use for, among other things, downloading files with bittorrent. I usually start these torrents by downloading them on my primary computer and then dropping them onto an alias to my server's torrents folder, which my bittorrent client (Transmission) monitors so that it can start the torrents automatically. I occasionally wanted to use my iPod Touch to start these torrents, but Mobile Safari refuses to download torrent files. My solution was to use Javascript to alter the torrent link to send its URL to my server for download rather than trying to open it. A PHP script on the server could then download that URL to the torrents folder. With both scripts in place, and the permissions of the torrents folder modified to allow Apache to write files, all I have to do is run the Javascript as a bookmarklet before clicking the torrent link, and click the link to download the torrent file. The modified link will pas...
published on Wednesday, the 26. December 2007, macosxhints
An AppleScript to Google search the current site in Safari
After I updated to Safari 3, AcidSearch stopped working properly, so I uninstalled it. I got Inquisitor instead, but I missed the ability to do a Google site search on whatever site I was visiting. So I put together this AppleScript, mostly assembled from other people's scripts: set search_object to text returned of (display dialog "Enter search object" default answer "") tell application "Safari" set url_current to URL of front document end tell set url_current to text ((offset of ":" in url_current) + 3) through length of url_current set url_current to text 1 through ((offset of "/" in url_current) - 1) of url_current set new_url to "http://www.google.com/search?q...:" & url_current & " " & search_object tell ...
published on Thursday, the 13. December 2007, macosxhints
10.5: Remove the 'downloaded file' warning flag
A Vista-esque feature of OS X 10.5 is that it tags web downloads (not just those from Safari) as such, and then warns you about running downloaded apps. Archived (e.g. zipped) files inherit the tags from their tagged container. This is an annoyance to power users, but, being a power user, I can do something about it. ;)Save the following script (original source) in ~/Library/Scripts/Folder Action Scripts. You'll probably need to create the Scripts directory and its subdirectory, e.g. with mkdir -p ~/Library/Scripts/Folder Action Scripts:(*"Unquarantine" by Henrik Nyh <http://henrik.nyh.se/2007/10/l...>This Folder Action handler is...
published on Friday, the 9. November 2007, macosxhints
10.5: Use Safari's new and improved Web Inspector
The web inspector that came with the Safari 3 Beta in Tiger has been given a total overhaul in Leopard. The inspector now does so much more: Syntax highlighting. The currently selected element in the Inspector is highlighted continuously on the web page unlike the simple red outline that would appear for a few seconds in the Beta inspector. All images, scripts and external resources used by the page are grouped and listed on the left. Implicit and explicit CSS styles, metrics and JS properties are provided on the right of the inspector. The console is included in the bottom left of the window and shows JS errors etc. Before, the console was only accessible through the hidden Debug menu. The Network functionality, just below Console, will prove to be very useful! This section provides detailed loading time...
published on Tuesday, the 6. November 2007, macosxhints