• 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: What is the best way to get the name (without the extension) of a file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the best way to get the name (without the extension) of a file?


  • Subject: Re: What is the best way to get the name (without the extension) of a file?
  • From: kai <email@hidden>
  • Date: Wed, 4 May 2005 22:12:12 +0100


On Wednesday, May 4, 2005, at 03:11 pm, Michelle Steiner wrote:

"Displayed name" will include the the extension if it is not hidden, so it won't work in all cases. This is what I came up with:

set Ext_hidden to the extension hidden of the_File
set the extension hidden of the_File to true
set the File_Name to the displayed name of the_File
set the extension hidden of the_File to Ext_hidden

Is there a better way? (You get to define "better.")

Ooh goody! ;-)

-----------------

on nameOnly for f
	tell (info for f)
		tell name extension to if it is missing value then
			set e to 0
		else
			set e to count
		end if
		tell name
			if e is 0 then return it
			text 1 thru -(e + 2)
		end tell
	end tell
end nameOnly

nameOnly for choose file

-----------------

---
kai

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: What is the best way to get the name (without the extension) of a file?
      • From: Gnarlodious <email@hidden>
References: 
 >What is the best way to get the name (without the extension) of a file? (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Nice Automator article on O'Reilly
  • Next by Date: name extension
  • Previous by thread: Re: What is the best way to get the name (without the extension) of a file?
  • Next by thread: Re: What is the best way to get the name (without the extension) of a file?
  • Index(es):
    • Date
    • Thread