2005-10-12T19:40:17ZFluxBBhttps://macscripter.net/viewtopic.php?id=24433Beginners often (smartly!) use AppleScript's recording feature to write scripts. This is an excellent learning tool, but adds a great deal of code that can be pruned to make scripts run faster.

For example, if you record moving a file on the desktop to the trash, you end up with:

Applescript:

Applescript:

tell application "Finder"to delete "aFile"

Another time saver is avoiding loops whenever possible. Suppose, for example, you had a folder on your desktop containing 1000 images, each ending with either .tif or .jpg, and you had to throw all of the .tif images in the trash. This loop would be a logical approach: