• 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: Simple newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple newbie question


  • Subject: Re: Simple newbie question
  • From: CYB <email@hidden>
  • Date: Thu, 18 Jun 2009 11:50:53 -0500
  • Thread-topic: Simple newbie question

Title: Re: Simple newbie question
How can I get just the name of a file without the extension?  If I use

set theName to (text 1 thru ¬
            (offset of "." in theFile) of theFile)

with say file '123.jpg' I get '123.'  I want just 123 without the "."

Thanks.

Pedro

As you can see there are many ways to solve a task, in my opinion is more easy this one

tell
application "Finder"
   set MyFile to alias "Lipstick:Users:g5:Desktop:HelveticaNeu.zip"
   set oldTID to AppleScript's text item delimiters
   set AppleScript's text item delimiters to {"."}
   set NameNoExtension to text item 1 of (get name of MyFile)
   set AppleScript's text item delimiters to oldTID
end tell
-->> “
HelveticaNeu”

Carlos Ysunza B.
Director
Ysunza/Santiago
Comunicación Visual • Automatización
Tel. (52)55 5256-0336
email@hidden

http://www.ysunzasantiago.com
http://www.thesecretmexico.com
http://www.softrobot.com.mx

 _______________________________________________
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

  • Follow-Ups:
    • Re: Simple newbie question
      • From: Michelle Steiner <email@hidden>
References: 
 >Simple newbie question (From: Peter Robertson <email@hidden>)

  • Prev by Date: Re: Plan E from Outer Space
  • Next by Date: Re: Simple newbie question
  • Previous by thread: Re: Simple newbie question
  • Next by thread: Re: Simple newbie question
  • Index(es):
    • Date
    • Thread