Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Turning off and on app in automator

I would like the actions necessary in automator to turn off an application in the morning and turn it back on in the afternoon each day.

MacBook Pro, OS X Mountain Lion (10.8.2)

Posted on May 27, 2013 1:20 PM

Reply
5 replies

May 27, 2013 6:47 PM in response to lburech

You need more than Automator.

You need to create a LaunchCtl plist that will activate at the time you want.

You could use it to call an Automator workflow that uses an Applescript Action to run the app and to quit the app.


tell application "Pages" to open

tell application "Pages" to quit


Lingon is a good app to use to create launchCtl items.

Here's some examples of how to do it manually.

http://alvinalexander.com/mac-os-x/launchd-examples-launchd-plist-file-examples- mac


For the run command, you can use

open -a AppName


To quit, you have to call Applescript using osascript (although there might be another way):

osascript -e "ignoring application responses" -e "tell application \"AppName\" to quit with saving" -e "end ignoring"

Jun 3, 2013 10:18 AM in response to Barney-15E

You certainly solved my question. It raised two additional questions which I hope you can address.

1. Once I scheduled the Automator in Calendar by saving my workflow, it sends an audible signal on my iPhones whenever it runs to open or quit the application. If I shut off the sound in the calendar, the application does not run. If I deselect the automator calendar on the iPhone, it reselects it as soon as it runs. I can live with this annoyance but wondered if this is an inherent property if I select the Calender as the "Type" before starting to develop my workflows.

2. The App that I lauched with the workflow requires a password. Can I modify the lauchworkflow to put in the password, so the application is up and about or must I put the password in manually?

Jun 3, 2013 3:59 PM in response to lburech

1) I had never looked into Calendar Alerts in Automator before you asked (hence my confusion). One guess I have is that it sends a Notification. Since you only need this on your Mac, put the event in an ON MY MAC calendar. Mine was automatically created there, so it didn't go to my iCloud devices.

If you don't have an ON MY MAC calendar, the only way I've found to create one is to turn on the Birthdays calendar in the preferences, select it from the list of Calendars, then right-click below it and select New Calendar.

The Automator Action actually created an Automator Calendar for me.


2) I don't know if that is possible.

Turning off and on app in automator

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.