Hi Guys,
No programming experience since 1979!! Trying to use applescript to get the name and extension of a file which is selected in the finder.
This tiny script:
tell application "Finder"
set theFile to selection
display dialog theFile as text
end tell
Gives me a window with the full path to the file - the folder delimiters are colons. I cannot find any way of getting just the name and extension out of this.
If I use: set fileName as (name of selection) - I get an error
If I use: set fileName as (name of theFile) - I get an error
This should be trivial but I cannot for the life of me figure it out.
Any hints would be greatly appreciated.
Kev
No programming experience since 1979!! Trying to use applescript to get the name and extension of a file which is selected in the finder.
This tiny script:
tell application "Finder"
set theFile to selection
display dialog theFile as text
end tell
Gives me a window with the full path to the file - the folder delimiters are colons. I cannot find any way of getting just the name and extension out of this.
If I use: set fileName as (name of selection) - I get an error
If I use: set fileName as (name of theFile) - I get an error
This should be trivial but I cannot for the life of me figure it out.
Any hints would be greatly appreciated.
Kev