[Automator] an Example

Bill White billwhite at mac.com
Wed Oct 19 06:54:34 PDT 2005


On 10/18/05 8:35 PM, demrcows <rc5cows at itswhat.com> wrote:

> I use a workflow available via contextual menu to replace the cookie file in
> iCab with an edited version containing only my desired cookies.

Thanks for sharing this, Fred. Very handy Automator action to have,
actually!

> iCab must not be running, so I had to use an Applescript to quit it
> before proceeding (the beep was just for grins.)
> 
> I'll describe my workflow in Automator
> 1) from the Library/Automator choose: "Run Applescript"
> and insert:
> tell application "Finder"
> if process "iCab" exists then
> beep
> quit application "iCab"
> end if
> end tell

As an AppleScript-specific observation, you can just ask iCab to quit
without checking whether it's running, and you could also get rid of the
hard-wired pause in the second step by combining steps 1 and 2 like this:

-----------------------
quit application "iCab"

tell application "Finder"
    repeat until not (exists process "iCab")
    end repeat
end tell

beep
-----------------------

If iCab isn't running this will just beep; if it is running then the simple
repeat loop will wait until it's fully quit before the beep comes (the beep
here just for fun, of course!).

HTH,

--Bill




More information about the Automator mailing list