How to suffix a task with Applescript

I once asked my friend to write a script to create a local folder of the same name for tasks to store related attachments, and I wanted to rewrite this script so that I could add a suffix to the task while creating the folder
My original script looked like this

tell application "OmniFocus"
	tell default document
		tell the front document window
			set theItem to selected tree of content
			set thePath to POSIX file "/Users/Fuguexv/Library/Mobile Documents/com~apple~CloudDocs/2022AU/2022AU_Inbox" as alias
			repeat with thisItem in theItem
				set folderName to name of thisItem
				set name of thisItem to folderName & "↗"
				set folderId to id of thisItem
				tell application "Finder"
					activate
					make new folder at thePath with properties {name:(folderName), comment:(folderId)}
					set the clipboard to folderName
				end tell
			end repeat
		end tell
	end tell
end tell

But it reports an error. How should I change it?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.