Re: clipboard contents into textfile.........
Re: clipboard contents into textfile.........
- Subject: Re: clipboard contents into textfile.........
- From: wemedge <email@hidden>
- Date: Thu, 11 Oct 2001 08:51:43 -0400
It looks like you are trying to call a handler without actuallty declaring
one. Try this:
on run
set the messageText to (the clipboard) as text
set fileTarget to "Macintosh HD:newfile" as text
writeData(messageText, fileTarget)
end run
on writeData(m, f)
try
set theFileReference to open for access file f with write permission
set eof theFileReference to 0
write m to theFileReference
close access theFileReference
on error errMsg number errNum
try
close access theFileReference
end try
error errMsg number errNum
end try
end writeData
I think this will help with your other posting as well.
Bill
>
The Script is :
>
>
on run
>
set the messageText to (the clipboard) as text
>
>
set fileTarget to "Macintosh HD:newfile" as text
>
>
writeData(messageText,fileTarget)
>
>
try
>
set theFileReference to open for access file fileTarget with write
>
permission
>
set eof theFileReference to 0
>
write messageText to theFileReference
>
close access theFileReference
>
on error errMsg number errNum
>
try
>
close access theFileReference
>
end try
>
error errMsg number errNum
>
end try
>
end writeData