Help with AppleScript to create a file alias

The solution I was trying, prompting for the user to choose a destination folder, is actually far from ideal, because it was quite difficult (at least for me…) to set the correct properties (title, tags, etc.) of the new alias file as in the source file. This could easily be achived with the import files command though, so I basically made use of EagleFiler’s “Duplicate Records” AppleScript and just made some modifications to create a Finder alias instead of a copy. The new alias records are created in the same container/folder as the selected records with an " alias" suffix, which can then be moved to the target folder within EagleFiler (e.g. using “Move To”).

I’m posting the AppleScript here if anyone finds this useful:

-- Largely adapted from EagleFiler's "Duplicate Records" applescript
tell application "EagleFiler"
	set _records to selected records of browser window 1
	tell library document 1
		repeat with _record in _records
			-- record path
			set theFile to _record's file
			set thePath to POSIX path of theFile
			-- set alias filename based on record's basename
			set theName to do shell script "basename " & thePath's quoted form
			set aliasName to theName & " alias"
			-- make temporary folder and set full path to target alias
			set tempFolder to do shell script "mktemp -d -t 'EFRecordAlias'"
			set tempPath to tempFolder & "/" & aliasName
			-- make the Finder alias
			set tempFolderAlias to (POSIX path of tempFolder)
			set tempFolderAlias to (tempFolderAlias as POSIX file) as alias
			tell application "Finder" to make new alias file at tempFolderAlias to theFile ¬
				with properties {name:aliasName}
			set tempFile to tempPath as POSIX file
			-- get record's properties
			set theContainer to _record's container
			set theTitle to _record's title
			set theFrom to _record's from name
			set theTags to _record's assigned tags
			set theNote to note text of _record
			-- set new properties for the alias
			set theTagNames to {}
			repeat with theTag in theTags
				copy theTag's name to end of theTagNames
			end repeat
			-- import the alias record
			set importResult to import files {tempFile} tag names theTagNames note theNote container theContainer
			set importedRecord to first item of importResult
			set importedRecord's title to theTitle
			set importedRecord's from name to theFrom
		end repeat
	end tell
end tell