On 9/16/03 3:32 PM, "Allen Watson" <[EMAIL PROTECTED]> wrote:
> On or near 9/16/03 11:18 AM, Bill White at [EMAIL PROTECTED] observed:
>
>> Safari's AppleScript dictionary doesn't seem to support "the selection" to
>> grab just highlighted text. If you don't object to copying the selection to
>> the clipboard, something like the following would work:
>>
>> -----
>>
>> tell application "Safari" to set theURL to URL of document of window 1
>>
>> set noteBody to theURL & return & return & (the clipboard)
>>
>> set noteName to text returned of (display dialog "Enter a name for the new
>> note..." default answer "Web clipping")
>>
>> tell application "Microsoft Entourage" to make new note with properties
>> {name:noteName, content:noteBody}
>
> If you are on OS X 10.2.3 or higher you can download and install the free
> "GUI Scripting" beta from Apple at <http://www.apple.com/applescript/GUI/>
> (a small download). Then, you could preface the above script with this code,
> which will perform a "Copy" to the clipboard for you.
>
> tell application "System Events"
> with timeout of 20 seconds
> tell application process "Microsoft Entourage"
> tell menu bar 1
> click menu item "Copy" of menu "Edit"
> end tell
> end tell
> end timeout
> end tell
If you want the copying to be done by Safari (which is what Bill's script is
intended for, the third line of the above script should be replaced with:
tell application process "Safari"
> You could generalize that as follows so it works with (almost) any app that
> has an Edit->Copy menu item:
>
> tell application "System Events"
> set procName to name of the first process whose frontmost is true
> with timeout of 20 seconds
> tell application process procname
> tell menu bar 1
> click menu item "Copy" of menu "Edit"
> end tell
> end tell
> end timeout
> end tell
--
Mickey Stevens (Microsoft MVP for Office:mac)
PowerPoint FAQ featuring PowerPoint:mac: <http://www.pptfaq.com/>
Entourage Help Page: <http://www.entourage.mvps.org/toc.html>
--
To unsubscribe:
<mailto:[EMAIL PROTECTED]>
archives:
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>