Hey Bob,
The overflow happens here on the designated line, because it is NOT in the Finder-tell-block.
-------------------------------------------------------------------------------------------
tell application "Finder"
set myName to "" # clear myName
try # Deal with All Conditions Met, Execute Actions with no selection
set myFile to the selection as alias
set myName to the name of myFile
display dialog "myFile = " & myFile & return & "myName = " & myName
end try
end tell
if myName contains "ƒ" then set myName to "" # don't add "ƒ" if it's already there
if length of myName ≠ 0 then # length of name of file selected
set the name of myFile to myName & "ƒ" --<< STACKOVERFLOW
end if
-------------------------------------------------------------------------------------------
I'd probably do something like this:
-------------------------------------------------------------------------------------------
tell application "Finder"
set itemList to the selection as alias list
if length of itemList = 1 then
set theItem to item 1 of itemList
set itemName to name of theItem
if itemName does not contain "ƒ" then set the name of theItem to itemName & " ƒ"
end if
end tell
-------------------------------------------------------------------------------------------