Prefix a folder name with a dialog returned word

Hi all,

I currently have the below script which adds space & brandName to the end of the existing folder name.
What I’m trying to do (and cannot figure out!) is have brandName space appear before the existing folder name when it’s dropped on the script application:



on open added_items
	set dropped to item -1 of added_items
	set brandName to text returned of (display dialog "What is the Brand name?" default answer "")
	tell application "Finder"
		set origName to name of dropped
		set newName to origName & space & brandName
		set name of dropped to newName
	end tell
end open


Any pointers greatly received
Regards

Simply changing the newName variable works for me, but I’m sure you tried this. What doesn’t work?

on open added_items
	set dropped to item -1 of added_items
	set brandName to text returned of (display dialog "What is the Brand name?" default answer "")
	tell application "Finder"
		set origName to name of dropped
		set newName to brandName & space & origName
		set name of dropped to newName
	end tell
end open

I am almost certain I tried every conceivable swap around of variables and it just didn’t work - now it does :mad: probably just long day fuzziness.
Thanks for your prompt and pointer!