【发布时间】:2016-08-21 10:28:55
【问题描述】:
如何在 AppleScript 中获取不带扩展名的文件名?例如:
Penny.Dreadful.S03E01.720p.HDTV.x264-BATV.mp4到
Penny.Dreadful.S03E01.720p.HDTV.x264-BATV
一个文件对我来说已经足够了,但可以放入更多文件。 以下代码采用文件名但带有扩展名。我不想要扩展名。感谢您的帮助。
try
set theNames to {}
tell application "Finder"
repeat with i in (get selection)
set end of theNames to name of i
end repeat
end tell
set {TID, text item delimiters} to {text item delimiters, return}
set the clipboard to theNames as text
set text item delimiters to TID
end try
【问题讨论】:
标签: applescript rename file-rename