I have had a few scripts now that work fine when I run the in script editor, but they don't run properly in automator. Automator has the ability to run applescript as part of a work flow by copying as pasting your applescript directly into Automator. I haven't had errors everytime I do it. But there are certain scripts that have had errors that have forced me to do some adjustments. Any ideas why? This recent script gave me the following error after copying and pasting it into an automator workflow.
Syntax Error
No result was returned from some part of this expression.
Here is the script:
(including automators on run, return input, and end tell commands added by automator within workflow.)
Syntax Error
No result was returned from some part of this expression.
Here is the script:
(including automators on run, return input, and end tell commands added by automator within workflow.)
Code:
on run {input, parameters}
tell application "Finder"
set theFolder to "Macintosh HD:Users:John:Desktop:Finished" as alias
set theList to name of (every file in theFolder)
end tell
repeat with i from 1 to (number of items of theList)
set theName to (item i of theList)
set item i of theList to ("http://www.mywebsite.com/mainfolder/" & theName)
end repeat
set theText to "
"
repeat with i from 1 to (number of items of theList)
set theText to (theText & (item i of theList) & "
")
end repeat
tell application "TextEdit"
activate
make new text document
set the text of the front document to theText
end tell
return input
end run