Jump to content
  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
Rafol

Apple script - count numbers of files

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.



×