I have created a renaming script that works just fine if the folder containing the file to be renamed is open on my desktop, but fails if the folder is closed and several levels deep.
This is what I am using:
A typical filepath looks like
::ServerName:VolumeName:Folder1:Folder2:Folder3:filename
set AppleScript's text item delimiters to {":"}
set argCnt to (the count of text items in FilePath)
set ServerName to (text item 3 in (FilePath)) as string
set VolumeName to (text item 4 in (FilePath)) as string
set newFilePath to (text items 4 through argCnt in (FilePath)) as string
--some steps here to get NewFileName
set name of file newFilePath to NewFileName
Thanks for any ideas about what I might be doing wrong.