Applescript can iterate on lists without using an index; remove unused variable; rename variables for clarity.