content: use AppleScript version "2.4" -- Yosemite (10.10) or later
  use framework "Foundation"
  use scripting additions
  
  on run
  	set theList to {"Marlow", "Maddie", "Sammy", "Stuey", "Jessie", "Tolstoy"}
  	set the itemCount to the count of theList
  	
  	set progress total steps to the itemCount
  	repeat with i from 1 to itemCount
  		set thisItem to item i of theList
  		set progress description to "Item " & i & " of " & itemCount
  		set progress additional description to thisItem
  		-- The delay is simply to simulate processing time 
  		-- so you can see the progress bar in action.
  		-- Exclude this from your code.
  		delay 1
  		set progress completed steps to i
  	end repeat
  end run
  
  -- --------------------
  -- FUNCTIONS
  -- --------------------
  -- The example above shows the raw method for implementing progress bars.
  -- The functions below are convenience wrappers for the same code to keep
  -- your overall code much cleaner and less repetitive.
  
  -- Create the initial progress bar.
  -- @param {int} 	 steps  			The number of steps for the process 
  -- @param {string} descript		The initial text for the progress bar
  -- @param {string} descript_add 	Additional text for the progress bar
  -- @returns void
  on progress_start(steps, descript, descript_add)
  	set progress total steps to steps
  	set progress completed steps to 0
  	set progress description to descript
  	set progress additional description to descript_add
  end progress_start
  
  -- Update the progress bar. This goes inside your loop.
  -- @param {int} 	 n  			The current step number in the iteration
  -- @param {int} 	 steps  		The number of steps for the process 
  -- @param {string} message   The progress update message
  -- @returns void
  on progress_update(n, steps, message)
  	set progress additional description to message & n & " of " & steps
  end progress_update
  
  -- Increment the step number of the progress bar.
  -- @param {int} 	 n            The current step number in the iteration
  -- @returns void
  on progress_step(n)
  	set progress completed steps to n
  end progress_step
  
  -- Clear the progress bar values
  -- @returns void
  on progress_end()
  	-- Reset the progress information
  	set progress total steps to 0
  	set progress completed steps to 0
  	set progress description to ""
  	set progress additional description to ""
  end progress_end
  