• 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
Problem with filenames containing Kanji chars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with filenames containing Kanji chars


  • Subject: Problem with filenames containing Kanji chars
  • From: Bill Hoffman <email@hidden>
  • Date: Wed, 23 Jan 2002 11:15:15 -0800

I can only conclude that this is a bug in AppleScript (OS X 10.1.2). Someon=
e
please confirm or let me know otherwise.

With the following script:

> set x to choose file
> tell application "Finder=B2
> set theFileName to name of x
> end tell
>>>=20
I get the following error:

=B3Can't get name of "path:filename".

When the filename contains kanji characters. I can=B9t get any properties of
the file.=20

Also, when I try to pass this filename from AS to a shell script (correctly
using POSIX path and escaping any "!$&\"'*(){[|;<>?~` \\" chars in the path=
)
I get a =8Cfile does not exist=B9 error message returned when trying to operate
on it. What gets passed to the shell script (no matter what type of string =
I
try and coerce it to) is a plain text string of high-bit chars that does no=
t
correspond to the string of high-bit chars for the filename I would get for
this file when globbing the filename in a shell script.

Can anyone explain?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html>
<head>
<title>untitled 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="GENERATOR" content="Script Debugger 3.0" />
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="black">
<td width="50%" height="20">
<font color="white" face="Geneva, Arial, Helvetica, sans-serif" size="2">
<a name="top"></a><b>untitled 2</b> (AppleScript)
</font>
</td>
<td width="50%" height="20">
<p align="right">
<font color="white" size="2" face="Geneva, Arial, Helvetica, sans-serif">Wednesday, January 23, 2002</font>
</p>
</td>
</tr>
<tr bgcolor="#dddddd">
<td width="100%" colspan="2"><font face="Lucida Grande" size="3" color="#000000"></font></td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2">
<font face="Geneva" size="2" color="#ff0000"><b>set</b></font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#408000">x</font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#ff0000"><b>to</b></font><font face="Geneva" size="2" color="#000000"> (</font><font face="Geneva" size="2" color="#0000ff">choose file</font><font face="Geneva" size="2" color="#000000">) </font><font face="Geneva" size="2" color="#ff0000"><b>as</b></font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#0000ff">Unicode text</font><font face="Geneva" size="2" color="#000000"><br />
<br />
</font><font face="Geneva" size="2" color="#ff0000"><b>tell</b></font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#0000ff">application</font><font face="Geneva" size="2" color="#000000"> "Finder"<br />
&nbsp;&nbsp;&nbsp;</font><font face="Geneva" size="2" color="#ff0000"><b>set</b></font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#408000">theFileName</font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#ff0000"><b>to</b></font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#0000ff">name</font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#ff0000"><b>of</b></font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#408000">x</font><font face="Geneva" size="2" color="#000000"><br />
</font><font face="Geneva" size="2" color="#ff0000"><b>end</b></font><font face="Geneva" size="2" color="#000000"> </font><font face="Geneva" size="2" color="#ff0000"><b>tell</b></font>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td colspan="2">
<font face="Geneva, Arial, Helvetica, sans-serif" size="2">
<a href="#top">Top</a> | <a href="http://www.latenightsw.com/";>Made with Script Debugger 3.0</a>
</font>
</td>
</tr>
</table>
</body>
</html>


  • Prev by Date: Folder Actions: Threat or menace
  • Next by Date: AS data types
  • Previous by thread: Re: Folder Actions: Threat or menace
  • Next by thread: Re: Problem with filenames containing Kanji chars
  • Index(es):
    • Date
    • Thread