Re: Long Filenames with Applescript
Re: Long Filenames with Applescript
- Subject: Re: Long Filenames with Applescript
- From: Chris Nebel <email@hidden>
- Date: Fri, 09 Mar 2001 11:02:28 -0800
- Organization: Apple Computer, Inc.
Matthew Van Drie wrote:
>
> >set name of fooFile to "New File Name"
>
> >
>
> >Unfortunately, I recieve an error if the new name is longer than 31
>
> >characters. Is there anyway to rename a file to a long name with
>
> >AppleScript?
>
>
>
> With or without AppleScript, you may not with current systems set a file
>
> name to be longer than 31 characters.
>
>
On MacOS 9.0 and later (perhaps a couple of releases earlier too?) you CAN
>
name a file longer than 31 characters -- the Finder just won't display
>
them as such (for example "This is a very very very long filename" will
>
become something like "This is a very very very lon#4a2b". Under MacOSX it
>
will show up properly). Does anyone know if/when this will become
>
available in AppleScript?
Mac OS 9.0 and later have the system APIs to handle long file names (though
they only work if the file system supports them -- HFS+, UFS, and NFS do; HFS
doesn't), but only the Mac OS X Finder supports them so far. So, in Mac OS
X, you can say things like:
tell application "Finder"
make new folder with properties {name: "This is a very very very long
folder name"}
end
...and it works just fine. "Info for" still gives you the HFS-mangled name;
we hope to fix that soon.
--Chris Nebel
AppleScript Engineering