• 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: Periods in string after concatenating ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Periods in string after concatenating ?


  • Subject: Re: Periods in string after concatenating ?
  • From: Shane Stanley <email@hidden>
  • Date: Mon, 30 Aug 2010 10:16:12 +1000
  • Thread-topic: Periods in string after concatenating ?

On 30/8/10 9:35 AM, "Hernan" <email@hidden> wrote:

> set new_name to first text item of name_file as string

As well as what David said about saving and restoring text item delimiters,
this will give you the wrong result if you want to strip off an extension
and the file in question has another period in it. Better to do:

set new_name to text 1 thru text item -2 of name_file

And if there's any chance of getting a file that doesn't have an extension:

if name_file contains "." then
set new_name to text 1 thru text item -2 of name_file
else
set new_name to name_file
end if

--
Shane Stanley <email@hidden>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Periods in string after concatenating ? (From: Hernan <email@hidden>)

  • Prev by Date: Re: Periods in string after concatenating ?
  • Next by Date: Library Modules and Library Loaders
  • Previous by thread: Re: Periods in string after concatenating ?
  • Next by thread: Re: Periods in string after concatenating ?
  • Index(es):
    • Date
    • Thread