• 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 class URL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode text and class URL


  • Subject: Re: Unicode text and class URL
  • From: Sander Tekelenburg <email@hidden>
  • Date: Tue, 23 Mar 2004 11:34:49 +0100

At 00:03 -0800 UTC, on 2004/03/23, Christopher Nebel wrote:

[...]

> Wrong. AppleScript's "string" class may contain style information, and
> when converting from Unicode text, always does, because the encoding is
> implied by the style.

So it does. I clearly was confused.

The reason I joined this thread was that I recently ran into an issue with
this. I had some Unicode text that I needed to edit (concatenate and/or
replace some characters) and couldn't because something choked on that style
information. I worked my way around it without really being aware of what was
going on. Unfortunately, for the life of me I can't remember nor reproduce
the exact problem, nor my workaround. I was too rushed getting the script
working when I should have bothered to understand what was actually going on.
What 'stuck' was simply that there was some problem converting Unicode text
to string.

Several days later someone on <news:alt.comp.lang.applescript> ran into the
same problem (just forwarded here by Michelle). And again a few days later
this came up here on AS-Users.

> If there's a bug here, it's that not all strings can be coerced to the
> "URL" class. The thing no one has asked yet is why the originator is
> bothering in the first place, since the "URL" class as it currently
> exists is fairly useless.

Probably true for this particular case, but this thread made me play with it
and I was pleasantly surprised to find that it can be used to find the IP
address behind a domain name:

set theIP to dotted decimal form of host of ("http://www.apple.com"; as URL)

(Haven't tried what happens when you run this while not connected to the Net.)


--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Unicode text and class URL (From: Bill Hoffman <email@hidden>)
 >Re: Unicode text and class URL (From: Walter Ian Kaye <email@hidden>)
 >Re: Unicode text and class URL (From: Sander Tekelenburg <email@hidden>)
 >Re: Unicode text and class URL (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Unicode text and class URL
  • Next by Date: Re: Fink and 'sh'
  • Previous by thread: Re: Unicode text and class URL
  • Next by thread: Mouse Click Event
  • Index(es):
    • Date
    • Thread