Re: Corce alias with Unicode (Japanese) to string fails
Re: Corce alias with Unicode (Japanese) to string fails
- Subject: Re: Corce alias with Unicode (Japanese) to string fails
- From: SSFactory <email@hidden>
- Date: Fri, 15 Oct 2004 00:08:09 +0900
On 04.10.14 9:19 PM, Christian Vick <email@hidden> wrote:
> This doesn't compile for me. I replaced the arrows with real chevrons but
> still get:
> Expected expression but found ≥´≤.
Please replace "<<" and ">>" with (ASCII character 199) and (ASCII character
200).
I cannot use these characters in E-mail on my (Japanese) environment.
> I don't have to use the Finder to coerce to file specification (at least on
> 10.3.5). It works without.
I wrote "file specification is Finder exclusive".
This is wrong, sorry.
(I misunderstood with "Finder's reference")
On 04.10.14 9:19 PM, Emmanuel <email@hidden> wrote:
>> Yes, coercing file specification to unicode text works well.
>> But file specification is Finder exclusive and unable to get the
>> file path easily.
>
> Not sure I understand. The following works on my machine (10.2.8):
>
> tell application "Finder"
> make new document file at desktop with properties {name:´data
> utxtD842DFB7ª}
> end tell
>
> set a to (choose file)
> set b to name of (info for a)
>
> -- this requires Smile
> set text of (make new Unicode window) to b
> -- the window displays the correct character
As you say, file name can be get correctly with this script, but
alias cannot be coerced to unicode string in following case.
--------------------------------------------------------------------
<Case 1>
This script causes an error.
tell application "Finder"
make new document file at desktop with properties {name:<<data
utxtD842DFB7>>}
end tell
set a to choose file --> Choose created file.
a as Unicode text
--> Error : Can't make alias ... into a unicode text
--------------------------------------------------------------------
<Case 2>
This script works without error, but the result is wrong.
tell application "Finder"
make new document file at desktop with properties {name:<<data
utxtD842DFB7>>}
end tell
set a to (choose file) as file specification --> Choose created file.
a as Unicode text
--> "Macintosh HD:Users:ssfactory:Desktop:???#10F8B7"
--------------------------------------------------------------------
<Case 3>
This script works correctly.
tell application "Finder"
set a to make new document file at desktop with properties {name:«data
utxtD842DFB7»}
end tell
a as Unicode text
--------------------------------------------------------------------
That is, once the file reference is coerced to alias, it cannot be coerced
to unicode text correctly when the file name contains surrogate pair, I
doubt.
Please let me know if there's my misunderstandings or the other way to
coerce alias to unicode text.
Thanks,
SSFactory
<email@hidden>
_______________________________________________
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