• 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: Luther Fuller <email@hidden>
  • Date: Mon, 26 Jan 2009 16:00:17 -0600

On Jan 26, 2009, at 3:34 PM, David Marshall wrote:

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)

It has been my experience, because I've verified it, too, that 'name of file ...' always returns the full name of the file including the extension. I recently commented "(Don't use 'displayed name', you don't know where that thing has been.)". In other words, 'displayed name' returns the extension only if you have "Show all file extensions" checked in Finder references. And, yes you CAN change this preference via AppleScript, but you probably shouldn't.


_______________________________________________
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: 
 >Re: Name only of app (From: David Marshall <email@hidden>)

  • Prev by Date: AppleScript/ Automator Action
  • Next by Date: Re: AppleScript-Users Digest, Vol 6, Issue 40
  • Previous by thread: Re: Name only of app
  • Next by thread: How to get Pattern Count of variable
  • Index(es):
    • Date
    • Thread