• 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
Re: Unicode text and the annoying relic called "styled text"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode text and the annoying relic called "styled text"


  • Subject: Re: Unicode text and the annoying relic called "styled text"
  • From: kai <email@hidden>
  • Date: Fri, 24 Dec 2004 22:32:39 +0000


On Fri, 24 Dec 2004 10:47:46 -0800, Pat Stanford wrote:

So is there a way to get a "string" without style information onto the clipboard?

We could use one (or a variation) of the methods discussed previously. As mentioned, if the "string" might be either plain or styled/encoded text, a try block or other means of handling plain text should be considered:


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

set t to "test" as Unicode text
try
	set the clipboard to (t as record)'s «class ktxt»
on error number -1700 -- coercion failure
	set the clipboard to t
end try

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

set t to "test" as Unicode text
try
	set the clipboard to (t as record as list)'s first string
on error number -1700 -- coercion failure
	set the clipboard to t
end try

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

set t to "test" as Unicode text
try
	set the clipboard to (t as record)'s text as text
on error number -1700 -- coercion failure
	set the clipboard to t
end try

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

set t to "test" as Unicode text
set {text:t} to t as string
set the clipboard to t

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

---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: [ANN] FastScripts 2.1
  • Next by Date: talking to remote applications
  • Previous by thread: Re: Unicode text and the annoying relic called "styled text"
  • Next by thread: AppleScript & Cryptography
  • Index(es):
    • Date
    • Thread