• 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: Name only of app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Name only of app


  • Subject: Re: Name only of app
  • From: David Marshall <email@hidden>
  • Date: Mon, 26 Jan 2009 16:34:23 -0500

On Sat, 24 Jan 2009 14:54:31 -0700, Michelle Steiner wrote:

On Jan 24, 2009, at 1:55 PM, David Marshall wrote:

Instead of using "displayed name" and testing for the presence of
the ".app" extension, why not just use "name" and strip the extension?


tell application "Finder" to set x to characters 1 thru -5 of ¬
	((name of (path to frontmost application)) as text) as text

Because not all applications have the extension as part of the name. None of the Adobe products in my Applications folder have it, for instance.

That's interesting. You mean if you do a Get Info on one of those Adobe apps and click the Name & Extension disclosure triangle, ".app" doesn't appear? Or is it just that Finder doesn't return the extension when you tell it to get the app's name?


I searched in vain in my own /Applications for an ".app"less application, using the following script:

set theFolder to path to applications folder from system domain
tell application "Finder"
	set theList to (name of every file of theFolder)
	set theExclusions to {}
	repeat with thisItem in theList
		if text -4 thru -1 of thisItem is not ".app" then
			set end of theExclusions to thisItem
		end if
	end repeat
end tell
theExclusions --> {}

- - - - -

Dave _______________________________________________
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: Name only of app
      • From: Luther Fuller <email@hidden>
    • Re: Name only of app
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Filemaker Script
  • Next by Date: Re: Name only of app
  • Previous by thread: Re: Name only of app
  • Next by thread: Re: Name only of app
  • Index(es):
    • Date
    • Thread