Re: "An error of type -619 has occured"
Re: "An error of type -619 has occured"
- Subject: Re: "An error of type -619 has occured"
- From: Nigel Garvey <email@hidden>
- Date: Thu, 11 Oct 2001 18:33:33 +0100
"kannan balu" wrote on Thu, 11 Oct 2001 17:07:36 +0530:
>
Hi All,
>
>
I having a problem of retrieving the clipboard contents into the AS. An
>
Execution Error occurs during runtime. The error is "type -619".
>
Can any one help to solve this problem. Thanks
>
>
The Script is :
>
---------------------------------------------------------------------------
>
tell application "kk" to activate
>
-- I am using sigma addition
>
type text "c" holding down command
>
>
>
set the messageText to (the clipboard) as text
The -619 error occurs when an application other than the frontmost one
tries to access the clipboard. In this case you've told "kk" to activate
(ie. come to the front) but it's the script itself (or the application
running it) that's being told to read the clipboard. You could try it
this way so that "kk" does everything:
tell application "kk"
activate
type text "c" holding down command
set the messageText to the clipboard as string
end tell
Or reactivate the script's application before setting the text variable:
tell application "kk" to activate
type text "c" holding down command
activate
set the messageText to the clipboard as string
Notice that I've used 'the clipboard as string' rather '(the clipboard)
as text'. The 'the clipboard' command has an 'as string' parameter which
returns the string directly from the command. ('As text doesn't work in
this case.) The version with parentheses returns the entire clipboard
data which is then coerced to string by AppleScript. It may work
sometimes, but it can also cause out-of-memory errors.
NG