Make a copy of PDF with Title name (PDF Metadata)

The workflow for this script is:

Input PDF file with PDF MetaData ‘Title’, set the Title to variable and write a new file with Title as file name in same directory as original file.

TODO: Ask for a option to type a Title (if Title is missing).

EDIT:
Include a option to send the original PDF to trash. (a new file need to be created to this to work)

use framework "Foundation"
use framework "Quartz"
use scripting additions

(**
* [pdfDocumentByTagTitle]
*)

set thePath to POSIX path of (choose file)

my pdfDocumentByTagTitle:thePath trashItem:"false"

on pdfDocumentByTagTitle:thePath trashItem:_boolean
	set theURL to current application's |NSURL|'s fileURLWithPath:thePath
	set theDir to POSIX path of ((theURL's URLByDeletingLastPathComponent()) as text)
	set theDoc to current application's PDFDocument's alloc()'s initWithURL:theURL
	
	set filemanager to current application's NSFileManager's defaultManager()
	
	if (theDoc is not missing value) then
		set theDict to (current application's NSMutableDictionary's alloc()'s initWithDictionary:(theDoc's documentAttributes())) as record
		try
			if ((Title of theDict) is not missing value) then
				set theTitle to Title of theDict
				
				set _writeToURL to current application's |NSURL|'s fileURLWithPath:(theDir & theTitle & ".pdf")
				theDoc's writeToURL:_writeToURL
				
				if (_boolean = "true") then
					set {theResult, destURL, theError} to filemanager's trashItemAtURL:theURL resultingItemURL:(reference) |error|:(reference)
				end if
			end if
		end try
	end if
end pdfDocumentByTagTitle:trashItem:

Most of the times I delete files manually but the method from NSFileManager didn’t use
Put Back function from trash folder in Finder.To translate a POSIX path to something Finder would accept took time. In other words I couldn’t 1 line of code so I use 2.

if (_boolean = "true") then
				set source to POSIX file thePath
				tell application "Finder" to delete source
				-- set {theResult, destURL, theError} to filemanager's trashItemAtURL:theURL resultingItemURL:(reference) |error|:(reference)
			end if

Does anyone know if there is ASObjC method to work with Finders ‘Put back’ ??