Search code examples
applescriptautomator

Toggle enable/disable for Automator app


I've got a monstrously large Automator application designed to be used by others without advanced-level computer skills. Basically, at a couple of points, I'd like users to be prompted to enable or disable the action that follows. The closest answer I've seen is:

automator enable/disable/delete action in run applescript

This is promising - I'm guessing this applescript method is the way forward. But this works for Automator workflows, not applications. I know so little about Applescript - even if it is possible, I wouldn't know how to do it. Anybody have any ideas?


Solution

  • I suggest breaking up your huge workflow into smaller pieces.

    One workflow can call other workflows, but workflows don't have a conditional statement. There is no way to do an if-statement, a conditional for a workflow.

    Automator actions such as "Run Shell Script" and "Run AppleScript" both have conditionals in them (if-statements).

    AppleScript allows the ability to call upon applications to get things done, and allows you to display simple dialogs.

    Shell scripts allow you to go deep inside of OS X, harnessing the power of Unix to work for you.

    Both AppleScript and shell scripting would be useful for you to add to your knowledge of Automator.

    AppleScript was actually designed to work with Mac applications. Look at the application:

    /Applications/Utilities/AppleScript Editor.app

    Beginner's tutorial on AppleScript:

    Beginner's tutorial on the Mac's Unix command-line:

    -- Kaydell
    [email protected]
    http://learnbymac.com