It's a bit of a trick, but the way I'd do this is to call an automator workflow inside an applescript loop. First you set up a workflow that looks like this (save it somewhere convenient):
Note carefully the two variables - NewName and FolderPath - and how they are used in the various actions. FolderPath is a path variable, NewName a text variable, and it's important that they get set up correctly, because that's how we get info into the workflow.
Once that's made and saved, copy the path to the workflow into the first line of the following script, run it in the applescript editor, and you should be good to go. (one note - it won't overwrite pdf files of the same name, so you might end up with duplicate files - filename 2. pdf, filename 3.pdf - if you run it on the same folder(s) a few times).
set workflow_path to "'/path/to/workflow.workflow'"
choose folder with multiple selections allowed
set the folder_list to the result
repeat with this_folder in the folder_list
-- get name and posix path of a folder
tell application "System Events"
set the folder_name to the name of this_folder
set the folder_path to POSIX path of this_folder
-- call automator workflow to process pdfs
do shell script "automator -D NewName=" & quoted form of folder_name & " -D FolderPath=" & quoted form of folder_path & " " & workflow_path