Re: 10.2.3
Re: 10.2.3
- Subject: Re: 10.2.3
- From: Takaaki Naganoya <email@hidden>
- Date: Fri, 20 Dec 2002 15:23:03 +0900
On 02.12.20 2:30 PM, "Paul Berkowitz" <email@hidden> wrote:
>
On 12/19/02 9:16 PM, "Takaaki Naganoya" <email@hidden> wrote:
>
>
> Thank you for your advice. But the code above couldn't solve the probrem.
>
> My whole testing code is like this.
>
>
>
>
>
> tell application "Finder"
>
> activate
>
> set a to choose folder
>
> set aPath to a as text
>
>
There's your error - of course 'as text' won't return accurate Japanese. It
>
returns mangled MacRoman string. Then it coerces the whole path to string
>
here:
>
>
> set tempName to aPath & aFile
>
>
Since 'aPath' on the left is string, the concatenation, include the part on
>
the right representing the file name, now is string as well, instead of
>
Unicode.
>
>
>
Replace the earlier line by
>
>
set aPath to a as Unicode text
>
>
and you should be OK. Unicode text, not text. It should work now. Everything
>
else in the Finder block (including name, comment) is in Unicode, and Excel
>
also uses Unicode so you don't need any more coercions.
Hmm....I rewrote my sample, but the result turns to more wrong.
This code returns wrong path and wrong filename in Japanese.
tell application "Finder"
activate
set a to choose folder
set aPath to a as Unicode text
set allFile to name of every file in folder a
set aList to {}
repeat with aFile in allFile
set tempName to (aPath as Unicode text) & aFile
set b to name of file tempName
set c to comment of file tempName
set aList to aList & {{tempName, b, c}}
end repeat
end tell
tell application "Microsoft Excel"
set Value of Range "R1C1:R1C3" to {"Full-Path", "File Name", "Comment"}
set cellR to 2
repeat with anItem in aList
set Value of Cell ("R" & cellR & "C1:R" & cellR & "C3") to anItem
set cellR to cellR + 1
end repeat
AutoFit EntireColumn of Range "C1:C3"
end tell
Takaaki Naganoya
A Chief Architect of Artifical Brain User Interface "Newt On"
http://www.airmac.org/newton_p.html
email@hidden
_______________________________________________
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: | |
| >Re: 10.2.3 (From: Paul Berkowitz <email@hidden>) |