• 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
Re: Long Filenames with Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Long Filenames with Applescript (From: Matt Van Drie <email@hidden>)

  • Prev by Date: Re: Long Filenames with Applescript
  • Next by Date: Re: Long Filenames with Applescript
  • Previous by thread: Re: Long Filenames with Applescript
  • Next by thread: Re: OS 9.1 Woes - AS Broken, How to Fix?
  • Index(es):
    • Date
    • Thread