• 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: More weird Unicode things
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More weird Unicode things


  • Subject: Re: More weird Unicode things
  • From: Helmut Fuchs <email@hidden>
  • Date: Fri, 3 Jun 2005 13:00:14 +0200

Hello jj,

I've been toying around a little on my system. And it works fine for me with Folders named in Japanese... BUT, using the greek characters from your example it fails.

Failing round-trip conversions from unicode to international text to unicode may be the reason for this. But this is only a wild guess.

The part that makes your script fail is the conversion of a list to a string with "as Unicode text", which fails on some items of the list and simply returns it unfinished.

(Thanks a lot to Mark Aldritt again: Without his Script Debugger it would have been MUCH harder to find out what's going on here.)

Use the following workaround and you'll hopefully be fine:

#####
pathnameandparent(choose file)
display dialog item 2 of result

to pathnameandparent(f)
	set AppleScript's text item delimiters to "/"
	set f to (POSIX path of f)'s text items
	set parentDir to ""
	repeat with i in items 1 thru -2 of f
                -- it's vital to explicitly make "/" into unicode text!!
		set parentDir to parentDir & ("/" as Unicode text) & i
	end repeat
	set parentDir to Unicode text 2 thru -1 of parentDir
	set fileName to item -1 of f
	set AppleScript's text item delimiters to {""}

	return {fileName, parentDir}
end pathnameandparent
######

If you'd be so kind to file a bug on this?

HTH,

Helmut
_______________________________________________
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


References: 
 >More weird Unicode things (From: jj <email@hidden>)

  • Prev by Date: More weird Unicode things
  • Next by Date: Re: EPS to JPEG
  • Previous by thread: More weird Unicode things
  • Next by thread: Re: More weird Unicode things
  • Index(es):
    • Date
    • Thread