Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Open Wikipedia Topic from Script Menu Internet
This short Applescript prompts you for a Wikipedia topic and opens the resulting page in Safari. There is a nice Wikipedia Dashboard widget, but sometimes you might want full browser access. You can save the script in the Script Menu (~/Library/Scripts/), so it's accessible no matter what application you're in. Wikipedia is smart enough to convert spaces to underscores in the URL, so it's no problem if your topic has spaces in it.
-- Wiki-Lookup
-- Quickly look up an item in Wikipedia

on run
	set Entry to display dialog "Lookup a Wikipedia entry:" default answer ""
	set textEntry to text returned of Entry
	set theURL to "http://en.wikipedia.org/wiki/" & textEntry
	tell application "Safari"
		activate
		make new document with properties {URL:theURL}
	end tell
end run
kirkmc adds: If you don't see the AppleScript menu in your menu bar, open AppleScript Utility (located in /Applications/AppleScript), and check Show Script Menu in menu bar. If you use a different browser, you can change the "Safari" in the script to the name of your browser.
    •    
  • Currently 2.25 / 5
  You rated: 5 / 5 (8 votes cast)
 
[8,653 views]  

Open Wikipedia Topic from Script Menu | 11 comments | Create New Account
Click here to return to the 'Open Wikipedia Topic from Script Menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Open Wikipedia Topic from Script Menu
Authored by: DougAdams on May 30, '07 07:45:13AM
Somewhat related: the AppleScript Search Wikipedia performs a "Go" search of Wikipedia in your default browser using the Album, Artist, or Composer tag of the single selected or currently playing iTunes track.

---
Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/

[ Reply to This | # ]

Wikipedia from anywhere anytime
Authored by: galaher on May 30, '07 08:22:09AM

I'm sure there are many ways to skin this cat, but I find the outstanding utility 'Butler' to do a great job of 'transparently' putting wikipedia at my finger tips, as well as any other searchable sites you may want to add, such as Google and my local library etc.



[ Reply to This | # ]
Javascript Bookmark
Authored by: queixa on May 30, '07 08:47:19AM
I've been doing something similar with a bookmark bar Javascript. I use the Search, instead of appending the name of the article, in case I don't have the title quite right.

I just create a new bookmark and edit the URL to the following:

javascript:a=prompt(%22Search%22);d=document;d.location.href=%22http://en.wikipedia.org/wiki/Special:Search?search=%22%20+%20a%20+%20%22&go=Go%22;

[ Reply to This | # ]
Much easier...
Authored by: dbs on May 30, '07 08:48:03AM

Want to search for "Apple"? With quicksilver you just type:

<command-space> wikip <tab> Apple <return>

Same for IMDB:
<command-space> imd <tab> Narnia <return>

or Amazon:
<command-space> ama <tab> Narnia <return>

or Google:
<command-space> goo <tab> Dangers of Wikipedia <return>

Much easier to remember since it's the same for any site. (And it's really easy to add other sites.)

BTW -- Never trust wikipedia for anything important. It's just simply not reliably nor authoritative for anything.



[ Reply to This | # ]
Open Wikipedia Topic from Script Menu
Authored by: deef on May 30, '07 09:42:11AM
Wikipedia searches are also available with <a href="http://free.abracode.com/cmworkshop/on_my_command.html">OnMyCommand</a>; -- once it's installed, you just select your search text, control-click, & search from the context menu. (Coming from Windows) I personally find context menus much less obtrusive than dragging the mouse up to the Scripts menu or rattling off all the keystrokes for Quicksilver. But as a previous poster said there are many ways to skin a cat :)

[ Reply to This | # ]
Open Wikipedia Topic from Script Menu
Authored by: deef on May 30, '07 09:43:43AM
oops...that was supposed to be HTML -- here's a working link: On My Command

[ Reply to This | # ]
Open Wikipedia Topic from Script Menu
Authored by: mbd on May 30, '07 05:51:01PM
Just to offer yet another way to skin this cat, I use either 'Sogudi' or 'SIA' with Safari (i've used both depending on which machine I'm on and they both do the same thing), which allows you to add keywords to the address bar of the browser. Doing a google or versiontracker search ought to point you to their respective homepages.

So, when I want to look something up, I open a new browser window, and enter

wikip search string

They also let you create customised searches, so if you want to search sites that include the keyword as part of the URL you can. I use it to do fast lookups of our intranet's directory of employees.

Also note that Firefox has this kind of functionality built in and call it 'Quick Searches' - you can see how they work and make your own by looking at the Quick Search section of the 'Organise Bookmarks' menu option

[ Reply to This | # ]

Open Wikipedia Topic from Script Menu
Authored by: robot_guy on May 30, '07 09:33:41PM
I use a script which allows me to do various things with a selection in OmniWeb:
(*DoXwithSelection is a collection of actions which I wish were available in OmniWeb's contextual menu; each takes as input the current selection in the front window and does something with it*)

set theList to {"Google Search", "Apple Support Search", "Wikipedia Lookup", "ARIN Whois"}

set theFocus to (choose from list theList)

tell application "OmniWeb" to activate
tell application "System Events"
	tell process "OmniWeb"
		keystroke "c" using {command down}
	end tell
end tell
delay 1
set theSelection to the clipboard

set thisURL to doXwith(theFocus as text, theSelection)

tell application "OmniWeb" to activate
tell application "System Events"
	tell process "OmniWeb"
		keystroke "t" using {command down}
	end tell
end tell

tell application "OmniWeb"
	set theId to id of front window
	OpenURL thisURL toWindow theId
end tell
to doXwith(thisFocus, thisSelection)
	if thisFocus = "Google Search" then
		set AppleScript's text item delimiters to " "
		set thisSelection to (text items of thisSelection)
		set AppleScript's text item delimiters to "+"
		set theSearchString to thisSelection as text
		set AppleScript's text item delimiters to ""
		set theURL to "http://www.google.com/search?hl=en&q=" & theSearchString & "&btnG=Google+Search"
	else if thisFocus = "Apple Support Search" then
		set AppleScript's text item delimiters to " "
		set thisSelection to (text items of thisSelection)
		set AppleScript's text item delimiters to "+"
		set theSearchString to thisSelection as text
		set AppleScript's text item delimiters to ""
		set theURL to "http://search.info.apple.com/?q=%22" & theSearchString & "%22&type=ktech+OR+klearn&search=Search&lr=lang_en&search=Go"
	else if thisFocus = "Wikipedia Lookup" then
		set theURL to "http://en.wikipedia.org/wiki/" & thisSelection
	else
		set theURL to "http://ws.arin.net/whois/?queryinput=" & thisSelection
	end if
	return theURL
end doXwith


[ Reply to This | # ]
Open Wikipedia Topic from Script Menu
Authored by: kquinn on Jun 01, '07 12:30:24AM

Hi, I've been playing around with Applescript Studio recently, and developed a little app for searching the urls (including Wikipedia) and the like I use most often. It's very much a work in progress, and was intended primarily as a learning exercise, but it's quite useful. (http://www.themacguy.smartemail.co.uk/quickfind.html)



[ Reply to This | # ]
Open Wikipedia Topic from Script Menu
Authored by: vaughnsc on Jun 01, '07 09:58:34AM
Yet another skinless cat with a nice touch:

I prefer the 'javascript in the bookmark bar' methodology and adapted the following Javascript lifted (in all fairness) from the Spanish Dictionary at rae.es - it has a twist: it can display a query dialog as expected, but will skip it if you've already highlighted (selected) a term in the frontmost browser window (useful when dealing with long phrases or convoluted, unfamiliar spelling):

javascript:Qr=window.getSelection();if(!Qr||Qr==''){void(Qr=prompt('Search%20Wikipedia%20for:',''))}if(Qr)location.href='http://en.wikipedia.org/wiki/'+escape(Qr)


Naturally, if you wish to direct the query to a non-English version of Wikipedia, it is a simple matter of tweaking the URL. You may also want to consider the previous comment of using WP's 'search' url instead of the less-forgiving 'article' URL.

[ Reply to This | # ]
Open Wikipedia Topic from Script Menu
Authored by: smkolins on Jun 01, '07 12:14:01PM
I use SafariSIA to configure wikipedia and a number of search alternatives.

---
Possess a pure, kindly, and radiant heart!

[ Reply to This | # ]