I’m stuck. I’m trying to write a simple applescript that will allow me to achieve branching in Automator. I just want to display a dialog that will allow the user to choose which route to take. Below is my applescript. This script works perfectly in Applescript Editor and returns the proper alias. But when I put it into a Run Applescript action in Automator, it will not return a result. The action does not display an error and appears to successfully complete, but no result is returned. In this example, I have created a folder on my desktop called “Workflows” and put the two referenced workflow files in in.
I’m pretty new at applescript. Any ideas why the action won’t return a result? Thanks
set theiPad to (path to desktop folder as string) & "Workflows:iPad.workflow" as alias
set theTape to (path to desktop folder as string) & "Workflows:Tape_Bin.workflow" as alias
display dialog "Are you use the iPad or the Tape Bin?" buttons {"iPad", "Tape Bin"}
if result = {button returned:"iPad"} then
return theiPad
else if result = {button returned:"Tape Bin"} then
return theTape
end if
Model: macbook pro
AppleScript: 2.2.3
Browser: Safari 536.26.17
Operating System: Mac OS X (10.8)