I am trying to automate a set of terminal commands. I was given the below instructions and manually doing it works just fine, but I wanted to know if there was a way to use the Mac "Automator" on my Mac to make a script/batch so all I have to do is click on it to apply all of these no matter what computer I want to run it on. Is that possible? (see below)

If the error persists, please try running these commands at the terminal to see if that corrects the issue:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  • Launch Terminal
  • Type sudo su then enter your password to log in as root
  • Type vi /Library/LaunchDaemons/com.apple.launchd.limit.plist
  • When in the vi editor, press i to enter insert mode then paste the exact code content above (Cmd-V). This will force the limit to 16384 files per process and 16384 files total
  • Save your file and quit using Esc followed by :wq
  • Reboot your system, and check that it is working using the command launchctl limit
  • It might be easier to edit this once (on one Mac) and then copy the whole file to all other computers involved. – nohillside Dec 2 '16 at 21:26
  • Terminal, sudo commands, vi editor, masks a very easy task. You need just create a file with name com.apple.launchd.limit.plist and copy and paste to /Library/LaunchDaemons/ folder in finder. Anyway I'll show how to create this in Automator. – Vagner Dec 2 '16 at 23:02

Here is a Automator task that can help you with.

1. Action: Get text
To do: Copy and paste desired text content.

First action

2. Action: New text file
To do: File format 'simple text'; save as 'automatortempfile.txt'; In Where is tricky, when you click will show a select folder location, press Cmd+Shift+g and type /var/tmp.

Second action

3. Action: Execute Applescript
To do: Copy and paste this content.

tell application "System Events"
    return text returned of (display dialog "Enter password" default answer "" with hidden answer)
end tell

This will open a dialog with a message "Enter password", that you must provide user password (this user must have admin rights, because this is required to write in /Library/* folder).

Third action

4. Action: Execute shell script
To do: Copy and paste this content.

sudo -S mkdir -p /Library/LaunchDaemons
sudo -S mv /var/tmp/automatortempfile.txt /Library/LaunchDaemons/com.apple.launchd.limit.plist

First line: Create a folder LaunchDeamons if doesn't exist (just for ensure that folder exists).
Second Line: Move your created file automatortempfile.txt from /var/tmp folder to /Library/LaunchDaemons/ and rename it to com.apple.launchd.limit.plist.

sudo -S will read password from stdin.

Fourth action

Now, just save and use!

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .