Add create.specific.file.number.scypt
This commit is contained in:
parent
8f57723b56
commit
494e06285b
24
create.specific.file.number.scypt
Normal file
24
create.specific.file.number.scypt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
Loading…
x
Reference in New Issue
Block a user