Skip to content

Instantly share code, notes, and snippets.

@kern-me
Last active October 8, 2018 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kern-me/873b1d42bd73fcfaa6eae6bc41f5a574 to your computer and use it in GitHub Desktop.
Save kern-me/873b1d42bd73fcfaa6eae6bc41f5a574 to your computer and use it in GitHub Desktop.
Applescript - Find the average of numbers in a list
-- Sum of numbers in a list
on listAvg(theList)
set the_list to theList
set a to 0
repeat with this_item in the_list
set a to a + this_item
end repeat
set avg to a / (count the_list)
return avg
end listAvg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment