Code/create.specific.file.number.scypt

25 lines
664 B
Plaintext

set baseDate to "20250102_"
set deptCode to "-KHCN_Missing"
-- Your list of numbers
set numberList to {790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 1269, 1270, 1423}
-- Choose folder
set targetFolder to choose folder with prompt "Select a folder to create the Missing files:"
repeat with n in numberList
set fileName to baseDate & n & deptCode & ".txt"
set filePath to (targetFolder as text) & fileName
try
set f to open for access file filePath with write permission
close access f
on error
try
close access file filePath
end try
end try
end repeat
display dialog "All empty files created successfully." buttons {"OK"} default button 1