Re: Safari/Entourage question
Re: Safari/Entourage question
- Subject: Re: Safari/Entourage question
- From: kai <email@hidden>
- Date: Fri, 07 Nov 2003 03:37:11 +0000
on Wed, 05 Nov 2003 08:42:16 +0000, phildobbin <email@hidden> wrote:
>
On 5/11/03 02:03, "kai" <email@hidden> wrote:
>
>
> Try something like this, Phil (untested):
>
>
[...]
>
>
> 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
>
>
This works perfectly. Thanks for the help, Kai.
Very pleased to hear that, Phil.
Of course, you could always make the script a bit more generic, so that it
(hopefully) works with any browser (whichever is the current default). To do
this, you could try replacing these lines from the above script:
>
> tell application "Safari"
>
> activate
>
> tell document 1 to set URL to s
>
> end tell
...with this:
---------------
open location s
---------------
---
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.