• 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: Incrementing digits in a file name (was: writing multiple files)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incrementing digits in a file name (was: writing multiple files)


  • Subject: Re: Incrementing digits in a file name (was: writing multiple files)
  • From: monk <email@hidden>
  • Date: Sun, 22 Jul 2001 12:56:49 -0400

-- 7/22/01 05:58 am: email@hidden said:

> -- 7/19/01 11:27 am: email@hidden said:
>
>> How about something like this?:
>>
>> -- begin script
>> set myPath to (path to desktop) as text
>> set myFilename to "myfile 00"
>>
>> repeat with i from 1 to 99
>> set myFilename to my IncrementFilename(myFilename)
>> log myPath & myFilename
>> end repeat
>>
>> on IncrementFilename(oldName)
>> set digits to (characters -1 thru -2 of oldName) as text
>> set digits to digits + 1
>> set newName to (characters 1 thru -3 of oldName) as text
>> if digits < 10 then set newName to newName & "0"
>> return newName & (digits as text)
>> end IncrementFilename
>> -- end script
>
> whenever i get to 'on', i get an error, ' expected "else", etc., but found
> "on".'
>
> what am i missing?

i think this one was my bad syntax, i had an unended if in the larger
framework, sorry!

but, now i get an error 'expected error but found identifier.'
>
> h 'monk' elmer
> --
>                        
> http://www.assemblage.org
>                        
> _______________________________________________
> applescript-users mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/applescript-users

h 'monk' elmer
--
                       
http://www.assemblage.org
                       


  • Follow-Ups:
    • Re: Incrementing digits in a file name (was: writing multiple files)
      • From: JollyRoger <email@hidden>
References: 
 >Re: Incrementing digits in a file name (was: writing multiple files) (From: monk <email@hidden>)

  • Prev by Date: Re: conditional error
  • Next by Date: Re: conditional error - my late night solution
  • Previous by thread: Re: Incrementing digits in a file name (was: writing multiple files)
  • Next by thread: Re: Incrementing digits in a file name (was: writing multiple files)
  • Index(es):
    • Date
    • Thread