Lisa's
AppleScripts
for Camino

Requirements
These scripts are for use with Camino 1.6 & 2.0, though some are limited to use with Camino 2.0b3 or later, as new AppleScript capabilities were introduced in that version. Scripts were tested with Mac OS X 10.5 but should work properly in 10.4. Other requirements specific to individual scripts are noted.

Installation
Unzip and move scripts to the path ~/Library/Scripts/Applications/Camino/ where the tilde (~) represents your home folder, creating any subfolders that don't already exist. The scripts will appear under a "Camino Scripts" heading in your system-wide Script menu when Camino is the frontmost application. Place scripts on the Camino toolbar by dragging them from the "Customize Toolbar" drop-down sheet.

Legacy Scripts
A small collection of scripts for Camino 1.5.5 is available for download here, but note that the Camino 1.5 branch is no longer supported.

Author Info
Email:  Lisa Thompson
MacScripter:  lthompson-22

Camino Links
Get Camino!
Discuss Camino at the
MozillaZine Camino Forum

Find more Camino add-ons at
Pimp My Camino

Add Image to iPhoto
This script will download the file displayed in Camino's current tab and add it to your choice of one or more of your iPhoto albums. The front tab must be showing the image file itself, so right-click on the target image and choose "View Image" from the contextual menu before running the script. The downloaded file will be permanently deleted after it has been successfully copied to your iPhoto Library. Requires iPhoto.
Close Background Tabs
This script will close all tabs in the active browser window except the current one and those displaying pages with titles that have been listed as exceptions. The script is designed to return your main browser window to a "default" state after a "new tab"-intensive browsing session. If there are certain pages you wish to exclude from being closed, all you need to do is open the script file and follow the simple instructions for adding their titles to the exceptions list.
Icon
Close Unnecessary Windows
This script will close all browser windows except the frontmost one, windows with more than one tab, and those displaying pages with titles that have been listed as exceptions. The script is intended as a quick way to dispense with unwanted pop-up and pop-under windows while preserving your main browsing window(s). If there are certain pages you keep open in windows of their own and wish to exclude from being closed, all you need to do is open the script file and follow the simple instructions for adding their titles to the exceptions list. This script comes with a custom icon designed by davedit, based on original icons by the Camino Team. Also thanks to davedit for the idea for the script.
Copy URL as BBCode Link
This script will get the URL and title of the page displayed in the current tab, format it as a BBCode link, and place it on the clipboard.
Copy URL as HTML Link
This script will get the URL and title of the page displayed in the current tab, format it as an html link, and place it on the clipboard.
Copy URL as Plain Text
This script will get the URL and title of the page displayed in the current tab, format it in two lines with the URL enclosed in angle brackets, and place it on the clipboard.
Download Page Text
This script will download the source text of the currently loaded page, convert it from html to plain text (ie. no codes, formatting, links or image references), save it as a Plain Text file in your Downloads folder (Leopard) or on your desktop (Tiger), and open it in your default text editor. Version 1.4 adds various improvements, including the option to have the downloaded file open in the background (open the script file in Script Editor to see the instructions for setting this option). Users of Camino v2.0b3+ should get the Save Page Text script instead of this one. Requires Mac OS X 10.4 or 10.5.
Email All Page Locations     *NEW*
This script will compile a list of all open pages in Camino's frontmost browser window, with the title and URL of each tab, and put it in the body of a new Apple Mail email message. Moreover, you can configure the script to automatically send the message to a particular email address (open the script file in Script Editor to see the simple instructions for doing so). Usage suggestion: I use this script to send page locations to myself, so I can take my iPod touch out in the fresh wifi-permeated air, retrieve the message, and quickly pick up browsing from where I left it in the office :-). Requires Apple Mail.
Email Page Contents
This script will open the current Camino page in Safari and engage Safari's "Mail Contents of This Page" feature, which activates your default email client and creates a new message containing the page contents, ie. rendered html with images, links, etc. Safari will then quit if it wasn't already open. Requires Mac OS X 10.4 or 10.5 and Safari 3 or later.
Email Page Source
This script will obtain the source code of the page displayed in Camino's current tab and put it in the body of a new Apple Mail email message, which will also include references to the web page's title and URL. Version 2.0 only: If there is text selected on the page, the script will provide source code for just the selection. Requires Apple Mail.
Email Page Text
This script will get the text selected in Camino's current tab, or complete text if there is no selection, and put it in the body of a new Apple Mail email message, which will also include references to the web page's title and URL. While the same functionality is provided by the Send Info to Apple App script, this script deals only with Mail and will perform its task without any dialogs. Requires Apple Mail.
Find/Set Lyrics of Current iTunes Track
This pair of scripts will 1. open a new tab and load a LyricWiki.org search results page for the track currently playing in iTunes and 2. set the lyrics of that track to the selected text. Please note that you will have to click on the appropriate link in the search results and then highlight the actual lyrics in between running the two scripts — that part of the process can't be automated. Nevertheless this is a pretty quick way to add lyrics to iTunes tracks from Camino. Version 2.0 only: The Find Lyrics script will now attempt to go directly to the current track's LyricWiki.org page; if doing so does not result in useful content, then a search results page will be loaded instead. Requires iTunes.
Get Crash Report
This script will present a list of recent Camino crash logs and place the text of the chosen log on the clipboard. For those involved in Camino testing and bug reporting.
Icon
Multi-Site Search
This script makes use of Camino's nifty bookmark shortcuts for searches feature. It will ask for a search term, present a list of search-shortcut bookmarks, and open search-result pages for the chosen sites in new tabs or windows (depending on your Tab Prefs settings). Your bookmarked searches must be saved in a Collection called "Searches" so the script knows where to find them. Please see the Read Me page for further information on setting up bookmark search shortcuts for use with this script. Version 1.1 makes an important bug fix and includes a custom icon for Camino's toolbar.
Open Page in Other Browser(s)     *UPDATED*
This script will open the currently displayed Camino page in one or more of the other browsers installed on your system. The list of browsers to choose from is offered each time the script is run and can include Firefox, Flock, Google Chrome, iCab, OmniWeb, Opera, Safari, SeaMonkey, Shiira and WebKit; support for additional browsers can be added upon request. Version 1.1 provides the option to set one or more browsers as default, pre-selected when the list dialog appears; open the script file in Script Editor and follow the instructions to set default choices. Version 1.2 adds support for Google Chrome. Requires at least one of the aforementioned browsers.
Open Page in Safari
This script will open the currently displayed Camino page in Safari, launching Safari if necessary, or in a new tab of Safari's frontmost window. Version 1.1 includes minor improvements.
Open Selected URL
This script will open a highlighted plain-text URL in a new tab or window (depending on your Tab Prefs settings). Note that you can more quickly open a selected URL via the Services menu (Camino > Services > Open URL in Camino, or Cmd-Shift-U); this script, however, will prevent the spawning of a new window/tab if the selection is not a valid URL and can be placed on the toolbar for mouse-click access.
Remember URL & Close Tab / Undo Close Tab
This pair of scripts will 1. Store the URL of the current tab and close it; 2. Re-open the last stored URL in a new tab. The first script now remembers URLs from the last 10 closed tabs for undoing in reverse order. (The URLs are stored in a text file called "camino-remembered-url.txt" in your Preferences folder.) Please note that the "Undo Close Tab" script only works on tabs that were closed with the "Remember URL & Close Tab" script; tabs closed by clicking the on-tab widget or by choosing Close from the File menu (Cmd-W) will not be remembered or restored. The script files have custom icons that look appropriate as buttons when the scripts are placed on Camino's toolbar; see this screenshot page for more information.

Acknowledgement: These scripts are based on the ideas and original scripts of Darren Mahaffy, Managing Editor of MacSurfer's Headline News™, used with permission. See this blog post by Darren for similar code that works with additional browsers, information on how to remap Cmd-W to trigger the script, and other suggestions for expanding the capabilities of the script.
Save Page Source     *NEW*
This script will save the html source of the page in the current tab, or the source of the selection if there is one, to a new .html file and open it in your default text editor or other application of your choice. The file is saved to either the Downloads folder (Leopard) or the Desktop (Tiger), or you may specify a folder of your choice within the script file. You can also set an option to open the saved file in the background. (Open the file in Script Editor and follow the instructions to set these options and customize the script's behavior.) This script offers an alternative to the "View Source in..." scripts for text/html editors that don't have the necessary applescript support for adding content to documents without saving it first.
Icon
Save Page Text     *NEW*
This script will save the text selected in the current tab, or complete page text if there is no selection, to a new Plain Text file and open it in your default text editor. The file is saved to either the Downloads folder (Leopard) or the Desktop (Tiger), or you may specify a folder of your choice within the script file (open it in Script Editor and follow the instructions). You can also set an option to open the saved file in the background. A custom toolbar icon is included with the script file. This script replaces the Download Page Text script for users of Camino 2.0b3+.
Icon
Save Web Note     *NEW*
This script will get the selected text from Camino's current tab and append it to a daily file. The first time you run the script on a given day, a new dated file is created in a Web Notes folder, which the script also creates as needed in your Documents folder. For instance, each time you run the script on June 24, 2009, the selected text will be saved to the file ~/Documents/Web Notes/webnotes-062409.txt. The script does not open the file, allowing you to surf-and-save until you decide it's time to review your notes. You should avoid, however, running the script while the file is open in another application, or unexpected results might occur. A custom toolbar icon is included with the file.
Send Info to Apple App
This script will get the text selected in Camino's current tab, or text of the entire page if there is no selection, and use it to create your choice of a new Mail message, Mail note, Pages document, iCal event, iCal to do item, or Address Book card. The new item will include a reference to the website name and its URL. Version 2.0 only: The script provides the option to set your choice of application document type as default, pre-selected when the initial dialog appears; open the script file in Script Editor and follow the instructions to set a default choice. Requires Apple Mail, iCal, and Address Book. (Pages is not required; if not installed, the option to create a new Pages document will not be offered).
Send Info to Entourage
This script will get the text selected in Camino's current tab, or complete page text if there is no selection, and send it to Entourage, asking whether it should be placed in a new email message, event, note or task. If event or task is chosen, the script will further ask for a start time or due date; dates can be entered in any format or left blank, but Entourage will throw an error if the text entered cannot be interpreted as a date. The new item will include a reference to the page name, URL, and current date. Tested with Microsoft Entourage 2004; might work with later versions.
Set Image as Desktop
This script will download the file displayed in Camino's current tab to your Pictures folder and set it as your Desktop picture. The front tab must be showing the image file itself, so right-click on the target image and choose "View Image" from the contextual menu before running the script. Known issues: If "Change picture:" is checked in your Desktop Preferences, the downloaded image might not display immediately. If the picture file is not of a type recognized for use as a Desktop Picture, no error is generated but your Desktop Picture setting might revert to default.
Validate Page Links
This script will send the URL of the current page to the Link Checker service provided by the World Wide Web Consortium (W3C), which will load in a new tab or window (depending on your Tab Prefs settings).
Validate Page Markup
This script will send the URL of the current page to the Markup Validation Service provided by the World Wide Web Consortium (W3C), which will load in a new tab or window. Two special cases, however, are handled differently: If the current page is a .css file, the URL will be sent to the CSS Validation Service instead. If the current page is a local file, the service's "validate by input" page will be displayed and the text of the file will be placed on the clipboard so it can be pasted in to the appropriate field.
View PDF File
This script will download the file at the URL on the clipboard, open it in its default application, and then expeditiously move it to the trash. This is useful for viewing PDF files "temporarily" — the PDF will open in Preview but the file will not be saved anywhere (unless you never empty the trash :-) ). To get the URL of a PDF on the clipboard, right-click on a link to the PDF and choose "Copy Link Location" from the contextual menu. (The script will act on any URL copied to the clipboard, whether it points to a PDF or some other kind of file. If the URL is for an image, say if you choose "Copy Image Location" from the contextual menu, the download will be opened in your default image viewing/editing application, before getting trashed.)
View Source in BBEdit     *NEW*
This script will obtain the source code of the page displayed in Camino's current tab and place it in a new, unsaved BBEdit document (unless the currently loaded page is a local file, in which case the file itself is opened in BBEdit); no new files are downloaded or created. If there is text selected on the page, the script will provide source code for just the selection. Requires BBEdit, a professional html and text editor developed by Bare Bones Software.
View Source in SubEthaEdit     *NEW*
This script will obtain the source code of the page displayed in Camino's current tab and place it in a new, unsaved SubEthaEdit document (unless the currently loaded page is a local file, in which case the file itself is opened in SubEthaEdit); no new files are downloaded or created. If there is text selected on the page, the script will provide source code for just the selection. Requires SubEthaEdit, a collaborative text editor developed by The Coding Monkeys.
View Source in TextEdit
This script will obtain the source code of the page displayed in Camino's current tab and place it in a new, unsaved TextEdit document (unless the currently loaded page is a local file, in which case the file itself is opened in TextEdit); no new files are downloaded or created. Version 2.0 only: If there is text selected on the page, the script will provide source code for just the selection. Requires Apple's TextEdit application.
View Source in TextWrangler
This script will obtain the source code of the page displayed in Camino's current tab and place it in a new, unsaved TextWrangler document (unless the currently loaded page is a local file, in which case the file itself is opened in TextWrangler); no new files are downloaded or created. Version 2.0 only: If there is text selected on the page, the script will provide source code for just the selection. Requires TextWrangler, an advanced text editor developed by Bare Bones Software.