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

Re: Unicode and languages


  • Subject: Re: Unicode and languages
  • From: Bill <email@hidden>
  • Date: Fri, 9 Apr 2004 13:57:05 +0800

Hanaan,

You may consider this approach:

-- make a sample file
-- cell A1 is in English, cell A2 is in Japanese
-- other assumptions: using English as system language, the font "Osaka" is installed
set jText to B+data utxt30C930E9304830823093B;
tell application "Microsoft Excel"
Create New Workbook
tell Sheet 1 of document 1
set Name of Font of Range "R1C1:R2C1" to "Osaka"
set Value of Cell "R1C1" to "Doraemon"
set Value of Cell "R2C1" to jText
end tell
end tell

Then, you may compare the first character, if it's a-z or A-Z, if yes, the cell is in English, if not, in your situation, it's in Japanese.

set alpha to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" as Unicode text

tell application "Microsoft Excel"
tell Sheet 1 of document 1
set x to Value of Range "R1C1:R2C1"
end tell
end tell

repeat with i in x
if character 1 of item 1 of (contents of i) is in alpha then
say "english"
else
say "not English"
end if
end repeat


Well, if you need to know exactly the code point of each character, you need to do it in another way.


bill
b be-$e/e0
<http://homepage.mac.com/cherish/triste/>
_______________________________________________
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.


  • Prev by Date: Re: Can iTunes run AppleScript as well as Trojan code?
  • Next by Date: Re: Unicode and languages
  • Previous by thread: Re: Unicode and languages
  • Next by thread: OS Failure Question
  • Index(es):
    • Date
    • Thread