Re: Name only of app
Re: Name only of app
- Subject: Re: Name only of app
- From: Michelle Steiner <email@hidden>
- Date: Sat, 24 Jan 2009 10:54:40 -0700
On Jan 24, 2009, at 10:31 AM, Robert Poland wrote: Is there a command that will get only the name and not the name and extension of an application?
tell application "Finder" to set x to name of (path to frontmost application)
tell application "Finder" to set x to the displayed name of (path to frontmost application)
Normally, ".app" is not displayed in the Finder in the name of an application; in fact, in the get info window for an application, "Hide extension" is checked and disabled, so it can't be unchecked.
Although I don't know of any situation where the extension is displayed, here is code to handle that possibility:
tell application "Finder" to set x to the displayed name of (path to frontmost application) if text -4 through end of x is ".app" then set x to text 1 through -5 of x end if x
-- Michelle
-- Rapture is not an exit strategy.
|
_______________________________________________
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