I have this exact code inside an automator "Run AppleScript" thing. The applescript works perfectly on its own but once I put it in the automator i get the same result i input into it (its supposed to remove the spaces). Any help is appreciated. Thanks in advance.
Code:
on run {input, parameters}
set movieName to input
set needle to " "
set replacement to ""
search_replace(movieName, needle, replacement)
end run
on search_replace(movieName, needle, replacement)
set old_delimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to needle
set temp_list to every text item of movieName
set AppleScript's text item delimiters to replacement
set return_value to temp_list as text
set AppleScript's text item delimiters to old_delimiters
return return_value
end search_replace