Jump to content

Apple script - count numbers of files


  • Please log in to reply
No replies to this topic

#1
Rafol

Rafol

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   Web hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy