• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
The Script Not Taking New Content From Clipboard......
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The Script Not Taking New Content From Clipboard......


  • Subject: The Script Not Taking New Content From Clipboard......
  • From: "kannan balu" <email@hidden>
  • Date: Tue, 16 Oct 2001 17:35:16 +0530

Hi Nigel,

I tried omitting the lines "tell application" & "end tell" and I also tried
putting "tell me" instead of "tell application kk". Even though the script
copies the newly selected text field into the Clipboard, the script writes
only the previous Clipboard content. That means the script works proper only
when I run the application twice.

(Description: If the Clipboard has the text "First". I changing the clipboard
content while calling the given below classicapplet by running an application
to the text "Second" and saving the clipboard content as simpletext. But the
text file has the text of "First" instead of "Second")

The Script is:
----------------------------------------------------------------------------
--------------

--tell application "kk" (I comment this line as per your suggestion) ***

activate

-- I am using sigma addition
type text "c" holding down command

set the messageText to the clipboard as string

--end tell (I comment this line as per your suggestion) ***

set fileTarget to "Macintosh HD:newfile" as string


writeData(messageText,fileTarget)

-- routine to write file

on 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


----------------------------------------------------------------------------
---------------

-Kannan


----- Original Message -----

  • Prev by Date: How to make file references to text
  • Next by Date: Re: How to make file references to text
  • Previous by thread: Re: How to make file references to text
  • Next by thread: Re: The Script Not Taking New Content From Clipboard......
  • Index(es):
    • Date
    • Thread