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 

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 

If you enable Scriptmenu.menu in /Applications/Applescript/ (just dbl-click
it), you can put this script into ~/Library/Scripts/ and have it available
in your menu bar system-wide.
-- 
Microsoft MVP for Entourage/OE/Word (MVPs are volunteers)
Allen Watson <[EMAIL PROTECTED]> Entourage FAQ site:
<http://www.entourage.mvps.org/>
AppleScripts for Outlook Express and Entourage:
 <http://members.thinkaccess.net/[EMAIL PROTECTED]/Scripts/>
Entourage Help Pages: <http://www.entourage.mvps.org/>


-- 
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/>

Reply via email to