Re: Error with clipboard in OS 8.1
Re: Error with clipboard in OS 8.1
- Subject: Re: Error with clipboard in OS 8.1
- From: Nigel Garvey <email@hidden>
- Date: Fri, 25 Jan 2002 13:20:25 +0000
Lars DeRuntz wrote on Thu, 24 Jan 2002 14:13:19 -0800:
>
tell application "Internet Explorer"
>
Activate
>
OpenURL "http://www.yahoo.com/"
>
set alphaSource to GetSource
>
end tell
>
>
tell application "Finder"
>
try
>
copy (alphaSource as text) to the clipboard
>
on error
>
set the clipboard to (alphaSource as text)
>
end try
>
end tell
>
>
I get an error, but can't make out why. Anyone have an answer, or guidance?
Three things.
Firstly, the application that accesses the clipboard has to the
frontmost, so you should either include 'set the clipboard to' in the
'tell application "Internet Explorer"' block, or else tell the Finder to
activate before accessing the clipboard. Based on the above snippet, I'd
prefer the former, as there's no reason to involve the Finder at all.
Secondly, 'set the clipboard to' isn't a 'set' command that works on the
clipboard; it's a command in itself. There's therefore no 'copy'
equivalent.
Thirdly, I don't remember for sure now, but I don't believe that the
clipboard commands were available in Mac OS 8.1. You'd need to install
Jon's Commands, the OSAX from which they were taken.
NG