• 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: Pat Cannon <email@hidden>
  • Date: Thu, 18 Jun 2009 14:27:16 -0500

Oh dang, yeah, mine fails with no extension so it needs to check for
that. I am lame.

This is better but not as neat:

tell application "Finder"
	set theItem to item 1 of (the selection as list)
	if name extension of theItem is "" then
		set baseName to (name of theItem)
	else
		set baseName to text 1 thru (-1 * ((length of ((name extension of
theItem) as text)) + 2)) of ((name of theItem) as text)
	end if
end tell

Incidentally, running it on "foo.potrzebie" does give me "foo" (on
10.4.11). Will the registered extensions thing break my script in
10.5?
 _______________________________________________
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: 
 >Re: Simple newbie question (From: Michelle Steiner <email@hidden>)
 >Re: Simple newbie question (From: CYB <email@hidden>)
 >Re: Simple newbie question (From: Pat Cannon <email@hidden>)

  • Prev by Date: Re: Simple newbie question
  • 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