2 Replies Latest reply: Oct 10, 2012 4:32 PM by Lockboard
Lockboard Level 1 Level 1 (45 points)

I'm trying to run an AppleScript in Automator, but it always fails in the part with a repeat loop. The error given is: "Syntax Error: No result was returned from some part of this expression."


Here is an example script that works in AppleScript Editor but not in Automator. Paste it in the "Run AppleScript" automator action:


repeat with i from 1 to number of items in {"red", "blue", "yellow"}

     set this_item to item i of {"red", "blue", "yellow"}

     if this_item is "blue" then

  display dialog "Blue" buttons {"OK"} default button 1

     end if

end repeat


Can anyone confirm they have the same problem and/or offer a solution?

MacBook Pro (13-inch Late 2011), OS X Mountain Lion (10.8.2), 8 GB RAM