Re: Long Filenames with Applescript
Re: Long Filenames with Applescript
- Subject: Re: Long Filenames with Applescript
- From: Pier Kuipers <email@hidden>
- Date: Thu, 8 Mar 2001 14:46:31 +0000
>
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?
As Emmanuel pointed out, that's not possible. However, you can a long
file name and truncate it to 31 characters with Applescript.
Something like:
tell application "Finder"
activate
set theQuery to display dialog "Create a folder with this name:"
[option-L]
default answer "This filename is longer than 31 characters"
set theDescription to (text returned of the result)
set x to count theDescription
if x > 30 then
set theDescription to (get characters 1 thru 30 of
theDescription) & "
" as text
end if
make new folder at desktop of startup disk with properties
{name:theDescription}
end tell
Hope this helps
Pier.
--
Pier Kuipers
Visual ID
* the Media Asset Management solution *
2 Whitefriars
Aungier Street
Dublin 2
Tel. +353 1 476 7059
Mobile +353 87 294 3063
Fax +353 1 478 1366
ISDN +353 1 602 0754
http://www.visualid.com