As you are running 10.9, I will not use ASObjC but old fashioned Applescript.
# for http://macscripter.net/viewtopic.php?id=45536
-- set theFolder to (path to desktop as text) & "Docs" # defines a text object
set theFolder to (choose folder with prompt "Select a folder:") # defines an alias object
tell application "System Events"
if class of theFolder is alias then
set theSubFolders to folders of theFolder
else
set theSubFolders to folders of folder theFolder
end if
repeat with aSubFolder in theSubFolders
set itsBeg to item 1 of my decoupe(name of aSubFolder, space)
log itsBeg
set theFiles to (files of aSubFolder whose visible is true)
repeat with aFile in theFiles
set name of aFile to itsBeg & name of aFile
end repeat
end repeat
end tell
#=====
on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
#=====