Hi folks, i am a newbie and i landed here in my quest for an existing, customizable Firefox or Safari applescript which would allow to search one term in several sites at once. Do you know of any?
This is to replace the great “Multi Site Search” applescript (by Lisa Thompson) that I use at least twenty times a day with Camino (a Cocoa Firefox-inspired browser, but which unfortunately is become more and more obsolete).
Here is the description as Lisa Thomphson’s homepage is presently unavailable : “Multi-Site Search 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 have to be saved in a Collection called “Searches” so that the script will know where to find them.”
And here is the script
-- Multi-Site Search v.1.1
-- Script by Lisa Thompson, lthompson.22@mac.com
-- <http://homepage.mac.com/lthompson.22/applescript/forcamino.html>
-- For use with Camino 1.6 & 2.0.
-- Tested in Mac OS 10.5, should work properly in 10.4.
-- Version 1.1: bug fix to ensure script aborts when user chooses "Cancel" from any dialog.
-- Install at the path ~/Library/Scripts/Applications/Camino, where ~ represents your home folder,
-- creating any subfolders that don't already exist; place on the Camino toolbar if desired.
-- Asks for a search term, presents a list of search-shortcut bookmarks saved in a "Searches" Collection, and
-- opens search-result pages for the chosen sites in new tabs or windows (depending on user pref settings).
-- See the script Read Me file at <http://members.cox.net/lthompson-22/mssreadme.html> for further
-- information on using this script, including how to create a Collection and how to bookmark a search shortcut.
tell application "Camino"
if not (exists (bookmark folder "Searches")) then
open location "about:bookmarks"
set alertMsg1 to "There is no \"Searches\" Collection of search shortcut bookmarks."
set alertMsg2 to "You must have your search shortcut bookmarks stored in a Collection called \"Searches\". In Bookmarks Manager, right-click in the Collections column and choose \"Add Collection\"."
display alert alertMsg1 message alertMsg2 as informational buttons {"OK"} default button 1 cancel button 1
return
end if
set srchBmarkList to name of every bookmark of bookmark folder "Searches" whose name is not "<Menu Spacer>"
if (srchBmarkList = {}) then
set alertMsg1 to "There are no search shortcut bookmarks in the \"Searches\" Collection."
set alertMsg2 to "You must have your search shortcut bookmarks stored in your \"Searches\" Collection. Click \"Learn More\" to see documentation on Camino's search shortcut bookmarks feature."
display alert alertMsg1 message alertMsg2 as informational buttons {"Cancel", "Learn More"} default button 2 cancel button 1
if result = {button returned:"Learn More"} then open location "http://caminobrowser.org/documentation/bookmarks/#shortcuts"
return
end if
set tPrompt to "Please enter a search term:"
set uSrchString to text returned of (display dialog tPrompt with title "Multi-Site Search" default answer ¬
"" with icon note buttons {"Cancel", "OK"} cancel button 1 default button 2)
set tPrompt to "Select one or more sites to search:"
set uBmarkList to choose from list srchBmarkList with title "Multi-Site Search" with prompt tPrompt ¬
OK button name "Search" with multiple selections allowed without empty selection allowed
if uBmarkList is false then return
repeat with aBmark in uBmarkList
open location my replaceChars((URL of bookmark aBmark of bookmark folder "Searches"), "%s", uSrchString)
end repeat
end tell
on replaceChars(srcText, oldChars, newChars)
if oldChars = "" then return srcText
set AppleScript's text item delimiters to oldChars
set tList to (every text item of srcText)
set AppleScript's text item delimiters to newChars
set srcText to (tList as text)
set AppleScript's text item delimiters to ""
return srcText
end replaceChars
I have no idea if such a script already exists for Firefox or Safari (googling it, i only found this).
If not, even though i am not applescript savvy, I could invest some time in trying to adapt LT’s script if you knowledgeable guys tell me it should be feasible and suggest a method. Any input welcome. Cheers,
HH
Model: Mac Mini
AppleScript: 2.0.1
Browser: Camino 2.1.2
Operating System: Mac OS X (10.5)