• 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: path to as string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: path to as string


  • Subject: Re: path to as string
  • From: has <email@hidden>
  • Date: Wed, 29 Jun 2005 01:11:31 +0100

Shane Stanley wrote:

> > What *I* don't understand (and [Matt] can answer this one in private) is
> > why any of this is relevant to users
>
>Let me try this one: because in practice, the whole business of Unicode text
>v string v MacRoman text causes all sorts of anomalies,

Have you any specific examples? I was trying to think of some earlier, but I could only really come up with various hoary old string vs Unicode text issues which isn't what Chris was asking about. There's probably quite a few older apps and osaxen that throw dreadful strops if they don't get exactly the typeText/typeStyledText/typeIntlText AEDesc they want (almost certainly a bug in the application), but the only one I could think of offhand is Finder's 'creator type' and 'file type' properties, which demand an AEDesc of typeText and choke on anything else:

tell application "Finder"
    set creator type of file "test.txt" of home to "ttxt" -- works with an AEDesc of typeText
    set creator type of file "test.txt" of home to ("ttxt" as Unicode text as string) -- breaks on an AEDesc of typeStyledText
end tell

Obviously a bug in Finder, but until it's fixed there'll always be folk who end up having to learn more about AppleScript's internals than is entirely healthy so they can work around it.

has

p.s. Just a reminder that TextCommands contains a variety of commands for converting between unicode text and strings (as well a whole bunch of other useful stuff).

http://freespace.virgin.net/hamish.sanderson/
 _______________________________________________
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

  • Follow-Ups:
    • Re: path to as string
      • From: Paul Berkowitz <email@hidden>
    • Re: path to as string
      • From: Shane Stanley <email@hidden>
    • Re: path to as string
      • From: Christopher Nebel <email@hidden>
  • Prev by Date: Re: path to as string
  • Next by Date: Re: path to as string
  • Previous by thread: Re: path to as string
  • Next by thread: Re: path to as string
  • Index(es):
    • Date
    • Thread