Re: Safari/Entourage question
Re: Safari/Entourage question
- Subject: Re: Safari/Entourage question
- From: kai <email@hidden>
- Date: Wed, 05 Nov 2003 02:03:03 +0000
on Tue, 04 Nov 2003 21:19:02 +0000, phildobbin <email@hidden> wrote:
>
I'm trying to modify a John Gruber script that grabs selected text in what
>
I've changed to Entourage X from Mailsmith and then queries it in Google in
>
my default browser which is set to Safari.
>
>
The original script used IE's getURL but there is no equivalent in Safari's
>
dictionary. Script follows:
>
>
tell application "Microsoft Entourage"
>
set s to selection of window 1 as string
>
if s = "" then
>
set s to text returned of ,
>
(display dialog "Search terms:" default answer "")
>
end if
>
set searchterms to ""
>
repeat with i from 1 to count words of s
>
set searchterms to searchterms & "+" & word i of s
>
end repeat
>
>
if s is not "" then
>
tell application "Safari"
>
activate
>
getURL("http://www.google.com/search?hl=en&q=";) & searchterms
>
end tell
>
end if
>
end tell
>
>
Everything works fine up to the getURL when Entourage gives up an error
>
message saying Safari cannot continue getURL (for obvious reasons).
>
>
Any help appreciated as I can't see anything in Safari's dictionary to work
>
round this.
Try something like this, Phil (untested):
-------------------------------------------------------
(Any wrapped lines abutting the left edge of the window
should be reconnected to the end of the previous line)
-------------------------------------------------------
--=======================================================================
tell application "Microsoft Entourage" to set s to window 1's selection
if (count s) is 0 then set s to (display dialog "Search terms:" default
answer "")'s text returned
if (count s) is 0 then error number -128
set text item delimiters to "+"
set s to "
http://www.google.com/search?hl=en&q=" & s's words
set text item delimiters to {""}
tell application "Safari"
activate
tell document 1 to set URL to s
end tell
--=======================================================================
---
kai
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.