MACSCRPT Archives

January 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 17 Jan 2006 13:08:45 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
On Jan 17, 2006, at 12:55 PM, John Delacour wrote:

> If I run this script from Eudora’s Scripts menu (remember them??),  
> it reliably copies the selected text ( «class eStx» ) or else  
> selects all and reliably copies that ...
>
>
>         set _selectall to («class eStx» is "")
>         tell application "System Events"
>           if _selectall then keystroke "a" using {command down}
>           keystroke "c" using {command down}
>         end tell
>
> ... that is to say that if I paste after running the script, I get  
> what I expect.  But if I add anything to perform any operation on  
> the clipboard within the script, the clipboard does not contain the  
> text just copied but whatever was previously there.
>
> Is there any simple way round this?

Switch applications.  Bring finder to the front or some other  
application.  That at least was needed in OS 9.  There are many  
clipboards, one per app plus the main system one.  The main system  
one doesn't get updated until applications switch places.

In OS X the pasteboard doesn't get updated until you try to paste.   
When you cut or copy you promise the system that you will provide  
data of certain formats.  I think the promise is made on context switch.

Try it out and let us know.

-Mark
Its like a $2....

ATOM RSS1 RSS2