yeah. the mandatory move is already the first step - moving any newly saved PDF into one common folder say "PDF folder". i hope a sample example can make it clear.
ex: lets say i receive two PDFs in mail with the names "Bill-CC-11112013-Statement.PDF" & "Bill-Phone-Nov2013.PDF".
firstly, both these pdfs get hazeled into a common folder "AllPDFs".
next, to find out further categories, a script gets executed. This script figures out that both files are "Bills". It further figures out that one is a "CreditCard" statement while the other is a "Telephone" bill. so it returns "Bill" as category and "CreditCard" or "Telephone" as subcategory.
now the PDF first gets subsorted into "Bills" and then further subsorted into "Bills/CreditCard" or "Bills/Telephone".
However, there would be cases where the script does not see any pattern for sub-categorization. in such cases, it'd return category as "Bills" & subcategory as "Uncategorized".
I want to check the custom token for subcategory returned by the script to see if it is "Uncategorized" before subsorting it within the "Bills" folder. if it is, then i will let it remain in "Bills" folder and not initiate the second sub-sorting.
Note: above is one example. there are many other "category"/"Subcategory" that the script figures out parsing through a database.