Rename a folder with additional text with no path included

Hi all,

I’m struggling with a script I wish to utilise at the end of a workflow Applescript I have.
Below is the snippet of the code which goes at the end of my larger script.

At the moment the rename is including the entire path of the original folder in between the additional required name and the original folder name.

Eg - original folder name is:
707661 - JOB DETAILS

result I’m getting is:
RELEASED Dave’s Mac/Users/UK/Desktop/707661 - JOB DETAILS

when what I want is:
RELEASED 707661 - JOB DETAILS

This is the snippet of code:

set a to theDroppedItems
tell application "Finder" to set folder a's name to "RELEASED " & theDroppedItems

“theDroppedItems” is the variable of the original folder, in this instance “707661 - JOB DETAILS” which was defined earlier on in my larger script.

Any ideas how I can avoid getting the path in my rename folder code?

Any assistance greatly received.

Many thanks

Dave

First of all the plural form theDroppedItems is misleading because it implies a list.

You say that the script works basically so theDroppedItems is clearly an HFS path.

Ask the Finder for the name and change it

set a to theDroppedItems
tell application "Finder"
	set folderName to name of folder a
	set folder a's name to "RELEASED " & folderName
end tell

theDroppedItems is list of aliases. To get you dropped folder alias from this alias list you need item 1 of it:


set a to (item 1 of theDroppedItems) -- result: 1 alias

tell application "Finder"
   set folderName to name of a  -- result: text
   set name of a to "RELEASED " & folderName -- result: text
end tell

Thanks both - works as expected