我正好有 11 个文件。这些被命名为 1.jpg、2.jpg 到 11.jpg。我想出了以下一半的作品。
然而问题是只有一半的文件被处理。具体来说,仅处理奇数文件,即跳过第二个文件。有什么想法吗?
我注意到这个人在重命名文件夹时遇到了类似的问题,但是我没有足够的知识将它应用到我的场景中。在 AppleScript 中批量重命名文件夹,只会更改每个其他文件夹的名称
display dialog "Person ID number. (numerals only)?" default answer ""
tell application "Finder"
set personid to text returned of result
set home_path to home as text
set file1name to "_front"
set file2name to "_prof"
set file3name to "_neck"
set file4name to "_no_phon"
set file5name to "_phon"
set file6name to "_max"
set file7name to "_prof_max"
set file8name to "_relax"
set file9name to "_prof_relax"
set file10name to "_depress_no_phon"
set file11name to "_depress_phon"
tell folder (home_path & "Downloads:sagicphotos")
set name of file 1 to "PRN" & personid & file1name & "." & name extension of file 1
set name of file 2 to "PRN" & personid & file2name & "." & name extension of file 2
set name of file 3 to "PRN" & personid & file3name & "." & name extension of file 3
set name of file 4 to "PRN" & personid & file4name & "." & name extension of file 4
set name of file 5 to "PRN" & personid & file5name & "." & name extension of file 5
set name of file 6 to "PRN" & personid & file6name & "." & name extension of file 6
set name of file 7 to "PRN" & personid & file7name & "." & name extension of file 7
set name of file 8 to "PRN" & personid & file8name & "." & name extension of file 8
set name of file 9 to "PRN" & personid & file9name & "." & name extension of file 9
set name of file 10 to "PRN" & personid & file10name & "." & name extension of file 10
set name of file 11 to "PRN" & personid & file11name & "." & name extension of file 11
end tell
end tell