Thesaurus in Entourage

M

Mickey Stevens

No, there's no way that Entourage can access it. I've requested this
before. Hopefully it will appear in a future release. Your request here
should be recorded. Alternatively, you can send feedback using the web
form. In Entourage X or 2004, go to Help > Send Feedback on Entourage.
Otherwise, click on this direct link to enter Mac Product Feedback:
<http://register.microsoft.com/mswish/suggestion.asp>
 
A

Allen Watson

Not that I know of, but I wrote a script to do lookups on Thesaurus.com
using Safari. Firefox or Omniweb. I'll append it below; you can download it
compiled from my website at
http://homepage.mac.com/allen_a_watson/AppleScripts_For_You/

Script name is "Thesaurus lookup"

property brow : ""

set oc to the clipboard
set the clipboard to ""
tell application "System Events"
set theApp to name of first process whose frontmost is true
tell process theApp
-- Copy selected word
keystroke "c" using command down
end tell
delay 1 -- Wait for clipboard to get set
end tell
set X to the clipboard
set the clipboard to oc
if (count words of X) ‚ 1 then
display dialog "Word to look up?" default answer X
set X to text returned of result
end if
if (length of X) = 0 then
beep
set the clipboard to oc
return
end if

set theURL to "http://thesaurus.reference.com/search?q=" & X & "&db=roget"
set theApp to my getAppName()
--display dialog theApp
if theApp = "Microsoft Entourage" then
if brow = "" then
try
set brow to default web browser -- WC Handy osax
on error
display dialog "Choose your default web browser" default button
"Safari" buttons {"Firefox", "Omniweb", "Safari"}
set brow to button returned of result
end try
end if
if brow contains "Safari" then
tell application "Safari"
set the URL of document 1 to theURL
activate
end tell
else if brow contains "Omniweb" then
tell application "OmniWeb"
GetURL theURL
activate
end tell
else if brow contains "Firefox" then
tell application "firefox"
Get URL theURL
activate
end tell
else
display dialog "Don't know terminology for " & brow
end if
else
open location theURL
end if

on getAppName()
tell application "System Events"
set f to first process whose frontmost is true
return name of f
end tell
end getAppName
 
P

Paul Berkowitz

if theApp = "Microsoft Entourage" then
if brow = "" then
try
set brow to default web browser -- WC Handy osax
on error
display dialog "Choose your default web browser" default button
"Safari" buttons {"Firefox", "Omniweb", "Safari"}
set brow to button returned of result
end try
end if
if brow contains "Safari" then
tell application "Safari"
set the URL of document 1 to theURL
activate
end tell
else if brow contains "Omniweb" then
tell application "OmniWeb"
GetURL theURL
activate
end tell
else if brow contains "Firefox" then
tell application "firefox"
Get URL theURL
activate
end tell
else
display dialog "Don't know terminology for " & brow
end if
else
open location theURL
end if

Why all this, Allen?

Doesn't

open location theURL

or

tell me to open location theURL

(if Entourage is getting in the way?) take care of all possibilities for
default browser?

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
A

Allen Watson

Why all this, Allen?

Doesn't

open location theURL

or

tell me to open location theURL

(if Entourage is getting in the way?) take care of all possibilities for
default browser?

No, it does not. Try it. You can run "open location" from Script Debugger,
but if you run it from the Entourage script menu, it claims there is a
syntax error. Both forms. Even "Tell application 'Microsoft Entourage' to
handle URL theURL" gives a syntax error. This was the only way I could get
it to work.
 
P

Paul Berkowitz

No, it does not. Try it. You can run "open location" from Script Debugger, but
if you run it from the Entourage script menu, it claims there is a syntax
error. Both forms. Even "Tell application 'Microsoft Entourage' to handle URL
theURL" gives a syntax error. This was the only way I could get it to work.

I guess 'tell me' and 'tell AppleScript' send it back to current
application, which is Entourage, which has its own implementation of «event
GURLGURL» ('open location' as should be, but 'handle URL' in Entourage,
which has an interesting optional parameter for attachments but excludes
http and other protocols like ftp, allowing only mailto, nntp, and news). So
do this:

tell application "Finder" to open location theURL


That works.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
A

Alan S. Nusbaum

Of course, Office 2004, with Mac 10.3.7

Are there anyways of accessing the MS thesaurus. Often I am not on line and
would like to use the built in MS Dict/thes

--
Alan

Talent Ventures of California


Educational Partner of the Kennedy Center American College Theater Festival
(http://www.kennedy-center.org/education/actf/actfpdo.html#tvi)


Because e-mail can be altered electronically,
the integrity of this communication cannot be guaranteed.
 
P

Paul Berkowitz

The Thesaurus is not available in Entourage, only in Word. All you need o do
is copy the word to the clipboard, switch to Word. press option-command-R
(or Tools/Thesaurus) and paste.

If you'd rather use a script, this works:

tell application "Microsoft Entourage"
activate
try
set s to selection
if class of s is not Unicode text then error number -128
on error
beep 2
display dialog "You must first select a word." buttons {"Cancel"}
default button 1 with icon 0
return
end try
end tell

tell application "Microsoft Word"
set newDoc to make new document
set content of text object of newDoc to s
set theRange to text object of newDoc
activate
check synonyms theRange
close newDoc saving no
end tell

You could run that script from a keyboard shortcut in Entourage. (See "About
the script menu" in Entourage Help.)


It should be possible to get all the information from Word in the background
and present it in an Entourage Note, without switching apps. (Though less
usefully, since you can't format text - bold, etc. - in Entourage, and there
would be no secondary searches except by running the script again.) But it
can't be done at the moment due to a bug in Word's scripting that I've just
reported.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.



From: "Alan S. Nusbaum" <[email protected]>
Newsgroups: microsoft.public.mac.office.entourage
Date: Mon, 27 Dec 2004 22:47:03 -0800
Subject: Re: Thesaurus in Entourage

Of course, Office 2004, with Mac 10.3.7

Are there anyways of accessing the MS thesaurus. Often I am not on line and
would like to use the built in MS Dict/thes

--
Alan

Talent Ventures of California


Educational Partner of the Kennedy Center American College Theater Festival
(http://www.kennedy-center.org/education/actf/actfpdo.html#tvi)


Because e-mail can be altered electronically,
the integrity of this communication cannot be guaranteed.
 
A

Allen Watson

Here is a much shortened version of my Thesaurus lookup script, thanks to
Paul Berkowitz for a workaround to using "open location" from Entourage,
which has a command that conflicts with it. Incidentally, if put into the
system Script menu, or with Big Cat's contextual menu, the script will work
in any app as long as you select a word first.

I referred people to my website to download the script; the web interface
shows 0K as size, which is incorrect. You can download the script via my
iDisk public folder instead. Use Finder's Go Menu, iDisk, Other User's
Public Folder, username allen_a_watson.

Script name is "Thesaurus lookup"

set oc to the clipboard
set the clipboard to ""
tell application "System Events"
set theApp to name of first process whose frontmost is true
tell process theApp
-- Copy selected word
keystroke "c" using command down
end tell
delay 1 -- Wait for clipboard to get set
end tell
set X to the clipboard
set the clipboard to oc
if (count words of X) ‚ 1 then
display dialog "Word to look up?" default answer X
set X to text returned of result
end if
if (length of X) = 0 then
beep
set the clipboard to oc
return
end if

set theURL to "http://thesaurus.reference.com/search?q=" & X & "&db=roget"

tell application "Finder" to open location theURL
 
R

Richard H

Here is a much shortened version of my Thesaurus lookup script.

Script name is "Thesaurus lookup"

set oc to the clipboard
set the clipboard to ""
tell application "System Events"
set theApp to name of first process whose frontmost is true
tell process theApp
-- Copy selected word
keystroke "c" using command down
end tell
delay 1 -- Wait for clipboard to get set
end tell
set X to the clipboard
set the clipboard to oc
if (count words of X) ‚ 1 then
display dialog "Word to look up?" default answer X
set X to text returned of result
end if
if (length of X) = 0 then
beep
set the clipboard to oc
return
end if

set theURL to "http://thesaurus.reference.com/search?q=" & X & "&db=roget"

tell application "Finder" to open location theURL

Wouldn't compile :-(
 
A

Allen Watson

Wouldn't compile :-(
--
You probably forgot to join lines broken by the list manager. That's why I
gave instruction on how to download the compiled version from my iDisk,
public folder, allen_a_watson.

Don't do so right away; I am having to fix a problem with the script, which
I will report in my next post.
 
A

Allen Watson

I wrote a script to do lookups on Thesaurus.com using Safari. Firefox or
Omniweb.

So, I posted it. Paul Berkowitz questioned the complexity of my method of
opening the URL for thesaurus.com, and offered this method: tell application
"Finder" to open location theURL

I made the mistake of believing Paul without testing it. On my Mac, and that
of another user who tried it, this script gives the same error on "open
location" I was getting when using "tell me" or letting Entourage handle the
command, "some data was not the expected type". Or something to that effect.
So, I am herewith reposting the original version of my script, and will
upload a compiled copy to my iDisk, where you can download it using Finder's
Go menu to Open my Public Folder on my iDisk, username allen_a_watson.

Paul, if you can find a better way that works, let me know. I'd love to use
a shorter method.

Script name is "Thesaurus lookup"

property brow : ""

set oc to the clipboard
set the clipboard to ""
tell application "System Events"
set theApp to name of first process whose frontmost is true
tell process theApp
-- Copy selected word
keystroke "c" using command down
end tell
delay 1 -- Wait for clipboard to get set
end tell
set X to the clipboard
set the clipboard to oc
if (count words of X) ‚ 1 then
display dialog "Word to look up?" default answer X
set X to text returned of result
end if
if (length of X) = 0 then
beep
set the clipboard to oc
return
end if

set theURL to "http://thesaurus.reference.com/search?q=" & X & "&db=roget"
set theApp to my getAppName()
--display dialog theApp
if theApp = "Microsoft Entourage" then
if brow = "" then
try
set brow to default web browser -- WC Handy osax
on error
display dialog "Choose your default web browser" default button
"Safari" buttons {"Firefox", "Omniweb", "Safari"}
set brow to button returned of result
end try
end if
if brow contains "Safari" then
tell application "Safari"
set the URL of document 1 to theURL
activate
end tell
else if brow contains "Omniweb" then
tell application "OmniWeb"
GetURL theURL
activate
end tell
else if brow contains "Firefox" then
tell application "firefox"
Get URL theURL
activate
end tell
else
display dialog "Don't know terminology for " & brow
end if
else
open location theURL
end if

on getAppName()
tell application "System Events"
set f to first process whose frontmost is true
return name of f
end tell
end getAppName
 
A

Allen Watson

Here is a better version that does not try to find three different browsers
when you compile it:

property brow : ""

set oc to the clipboard
set the clipboard to ""
tell application "System Events"
set theApp to name of first process whose frontmost is true
tell process theApp
-- Copy selected word
keystroke "c" using command down
end tell
delay 1 -- Wait for clipboard to get set
end tell
set X to the clipboard
set the clipboard to oc
if (count words of X) ‚ 1 then
display dialog "Word to look up?" default answer X
set X to text returned of result
end if
if (length of X) = 0 then
beep
set the clipboard to oc
return
end if

set theURL to "http://thesaurus.reference.com/search?q=" & X & "&db=roget"
set theApp to my getAppName()
--display dialog theApp
if theApp = "Microsoft Entourage" then
if brow = "" then
try
set brow to default web browser -- WC Handy osax
on error
display dialog "Choose your default web browser" default button
"Safari" buttons {"Firefox", "Omniweb", "Safari"}
set brow to button returned of result
end try
end if
tell application brow to activate
if brow contains "Safari" then
run script ("tell application \"Safari\" to set the URL of document
1 to " & theURL)
else if brow contains "Omniweb" then
run script ("tell application \"Omniweb\" to GetURL " & theURL)
else if brow contains "Firefox" then
run script ("tell application \"Firefox\" to Get URL " & theURL)
else
display dialog "Don't know terminology for " & brow
end if
else
open location theURL
end if

on getAppName()
tell application "System Events"
set f to first process whose frontmost is true
return name of f
end tell
end getAppName
 
P

Paul Berkowitz

So, I posted it. Paul Berkowitz questioned the complexity of my method of
opening the URL for thesaurus.com, and offered this method: tell application
"Finder" to open location theURL

I made the mistake of believing Paul without testing it. On my Mac, and that
of another user who tried it, this script gives the same error on "open
location" I was getting when using "tell me" or letting Entourage handle the
command, "some data was not the expected type". Or something to that effect.
So, I am herewith reposting the original version of my script, and will upload
a compiled copy to my iDisk, where you can download it using Finder's Go menu
to Open my Public Folder on my iDisk, username allen_a_watson.

Paul, if you can find a better way that works, let me know. I'd love to use a
shorter method.

I can't tell you anything else. It works perfectly here, from the Entourage
script menu. You also replied to me once already that it worked for you too,
right? What I tested before was simply

tell application "Finder" to open location "http://www.macnn.com"

and it worked perfectly. Now I've tested a terse version of your script and
it too works perfectly:


set oc to the clipboard
set the clipboard to ""
tell application "System Events"
set theApp to name of first process whose frontmost is true
tell process theApp
-- Copy selected word
keystroke "c" using command down
end tell
delay 1 -- Wait for clipboard to get set
end tell
set X to the clipboard
set the clipboard to oc
if (count words of X) ‚ 1 then
display dialog "Word to look up?" default answer X
set X to text returned of result
end if
if (length of X) = 0 then
beep
set the clipboard to oc
return
end if

set theURL to "http://thesaurus.reference.com/search?q=" & X & "&db=roget"

tell application "Finder" to open location theURL


---------------

This works perfectly from the Entourage script menu here.


Don't forget with the version you posted just before, since it has a script
property brow, no one who tries to save the script in Script Editor in
Panther, or the current version of Smile (since 1.6) will ever be able to
save the browser name. Scripts made in Script Editoe or Smile 1.6.x will not
save changes to properties when run for mthe Entourage script menu. If you
created a bersion in Script Debugger and posted that they can download it.

But I get nothing wrong with the script above. It works very fast too.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
P

Paul Berkowitz

This works perfectly from the Entourage script menu here.

Also, don't forget that the original poster did write back the other day to
say that he preferred a method for when he's not online and can't use a
browser. The script I sent to open the Word Thesaurus works just fine. I
don't know if its Thesaurus is as complete as Roget's - maybe not.

There is a way to display Word's results in an Entourage note - there's no
bug after all. I'm not sure that there's any advantage, however.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
A

Allen Watson

I don't know why, but it didn't work for me. I'm too busy to go back and try
it again (no time yet to work on you-know-what; tomorrow for sure). I'll
save your version and try it later.

For those who are trying to use my script last posted, it had a bug; it
worked for me once, then no longer, and I can't figure how it ever worked!
The fixed version is up on my iDisk. Here is a copy of the source:

property brow : ""

set oc to the clipboard
set the clipboard to ""
tell application "System Events"
set theApp to name of first process whose frontmost is true
tell process theApp
-- Copy selected word
keystroke "c" using command down
end tell
delay 1 -- Wait for clipboard to get set
end tell
set X to the clipboard
set the clipboard to oc
if (count words of X) ‚ 1 then
display dialog "Word to look up?" default answer X
set X to text returned of result
end if
if (length of X) = 0 then
beep
return
end if
set theURL to "http://thesaurus.reference.com/search?q=" & X & "&db=roget"
set theApp to my getAppName()
--display dialog theApp
if theApp = "Microsoft Entourage" then
if brow = "" then
try
set brow to default web browser -- WC Handy osax
on error
display dialog "Choose your default web browser" default button
"Safari" buttons {"Firefox", "Omniweb", "Safari"}
set brow to button returned of result
end try
end if
tell application brow to activate
if brow contains "Safari" then
run script ("tell application \"Safari\" to set the URL of document
1 to \"" & theURL & "\"")
else if brow contains "Omniweb" then
run script ("tell application \"Omniweb\" to GetURL \"" & theURL &
"\"")
else if brow contains "Firefox" then
run script ("tell application \"Firefox\" to Get URL \"" & theURL &
"\"")
else
display dialog "Don't know terminology for " & brow
end if
else
open location theURL
end if

on getAppName()
tell application "System Events"
set f to first process whose frontmost is true
return name of f
end tell
end getAppName
 
A

aRKay

Allen Watson said:
For those who are trying to use my script last posted, it had a bug; it
worked for me once, then no longer, and I can't figure how it ever worked!
The fixed version is up on my iDisk.

Your Thesaurus lookup\coT posted to your iDisk at 29-Dec-04 7:34 PM is
still broken. It generates an error message saying

Safari got an error:
NSReceiverEvaluationScriptError 4

FYI, it worked one time then started generating the above error. I
wonder if the 7:34 PM is the latest patched version?

aRKay
 
A

aRKay

aRKay said:
Your Thesaurus lookup\coT posted to your iDisk at 29-Dec-04 7:34 PM is
still broken. It generates an error message saying

Safari got an error:
NSReceiverEvaluationScriptError 4

FYI, it worked one time then started generating the above error. I
wonder if the 7:34 PM is the latest patched version?

aRKay

Allen Watson's script works great standalone but fails when run from the
Entourage X menu. Anyone been able to get his script to run under
Entourage 2004? Maybe it is me doing something wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top