Create an automator task that adds whole folders as mail attachments

Perhaps the canPerformWithItems method allows you to check specific items in the script and is just a form of error checking. I edited the last section of my script as follows and got expected results.

--make email
set aSharingService to current application's NSSharingService's sharingServiceNamed:(current application's NSSharingServiceNameComposeEmail)

aSharingService's canPerformWithItems:{anAttributedString} --> true
aSharingService's canPerformWithItems:theAttachments --> true
aSharingService's canPerformWithItems:allItems --> true
aSharingService's canPerformWithItems:{theData} --> false

If the above is correct, I’m still not sure what is accomplished by checking an email address. The script works well, so there’s probably no reason to overthink this.