Applescript: Get filenames in folder without extension

前端 未结 8 1795
忘掉有多难
忘掉有多难 2020-12-11 03:36

I can get the names of all files in a folder by doing this:

tell application \"Finder\"
    set myFiles to name of every file of somePath
end tell

8条回答
  •  [愿得一人]
    2020-12-11 04:17

    For a single file I found the answer here, copied below.

    set theFileName to "test.jpg"
    set thePrefix to text 1 thru ((offset of "." in theFileName) - 1) of theFileName
    

提交回复
热议问题