• 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: file name mutations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file name mutations


  • Subject: Re: file name mutations
  • From: "Marc K. Myers" <email@hidden>
  • Date: Mon, 17 Sep 2001 02:22:17 -0400
  • Organization: [very little]

> Date: Mon, 17 Sep 2001 13:18:50 +1200
> Subject: file name mutations
> From: Andrew Simpson <email@hidden>
> To: <email@hidden>
>
> can somebody tell me how i would do the following...
>
> check for file names with the following name convention:
>
> file name = nz1711jr-11028812.eps
>
> sometext-six digit number plus incrementer.
>
> and convert the file name to the following:
>
> file name = 11028812.eps
>
> ie chop the front off to the hyphen.
>
> i'm sure its quite easy to those in the know but i haven't got my head
> around the whole text manipulation routines as i'm used to VB with all the
> functions built in.
>
> split it and right it and away we go...
>
> any help appreciated.
>
> Andrew.

set fileName to "nz1711jr-11028812.eps"
set fileName to text -12 thru -1 of fileName -- last 12 characters
-->"11028812.eps"

or

set fileName to "nz1711jr-11028812.eps"
set od to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"-"}
set fileName to text item 2 of fileName -- everything after the dash
set AppleScript's text item delimiters to od
fileName
-->"11028812.eps"

Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[9/17/01 2:17:46 AM]


  • Prev by Date: Re: file name mutations
  • Next by Date: Re: OT - Your Comments on the recent
  • Previous by thread: Re: file name mutations
  • Next by thread: Chooser problem
  • Index(es):
    • Date
    • Thread