Applescript to get file name without extension
applescript
Solution
You can ask the Finder or System Events for the name extension and remove that part from the full name. This will also avoid issues with names that have periods in them or extensions that may not be what you think they are.
set someItem to (choose file)
tell application "System Events" to tell disk item (someItem as text) to set {theName, theExtension} to {name, name extension}
if theExtension is not "" then set theName to text 1 thru -((count theExtension) + 2) of theName -- the name part
log theName & tab & theExtension
Problem
I have an applescript where the user will pick one file and i need to get the name of that file minus the extension. I found a post on a different site that said this would work: ``` tell application "Finder" set short_name to name of selected_file end tell ``` But it returns the extensions as well. How can I get just the name of the file?