Jump to content

Apple script - count numbers of files


Rafol
 Share

1 post in this topic

Recommended Posts

Hi guys,

i have this script:

 

now my question is how can i replace the "choose folder" into fixed folder for example a folder that on my desktop?

 

 

Thanks,

Rafi

 

tell application "Finder"

set chosen_folder to choose folder

set folder_name to name of chosen_folder

count every file in folder chosen_folder

set file_total to result

count every folder in folder chosen_folder

set folder_total to result

set the_total to (file_total + folder_total)

if the_total = 88 then

else

display dialog "There are " & file_total & " files and " & folder_total & " folders in the folder." & return & ¬

"Total items equals " & the_total & " but expected to be 88 files - error on test"

end if

end tell

Link to comment
Share on other sites

 Share

×
×
  • Create New...