A collection of commands that may be from a CLI Shell, or programming language such as AppleScript, which are executed in order with limited iteration, usually as a way of automating actions or events.

learn more… | top users | synonyms (2)

20
votes
5answers
11k views

Possible to run scripts on sleep and wake?

MacBook Pro 2010 running OS X Lion. Is it possible to run scripts on sleep and wake events? My specific application is that I've got Dropbox-synced Truecrypt volumes that I regularly use on both my ...
19
votes
5answers
7k views

How can I change a file or folder icon using the Terminal

How can I change or set the icon for a file or folder, in the terminal, do I need to use a scripting language?
17
votes
4answers
3k views

Concisely starting Mac OS apps from the command line

I do a fair amount of work in the command line, and I find myself defining a lot of aliases of the form: alias skim='/Applications/Skim.app/Contents/MacOS/Skim' Is there a way to add magic such ...
12
votes
2answers
4k views

What is the difference between .command, .tool, and .sh file extensions?

I saw a couple of questions about executing command line scripts? I saw that the .command and .tool extensions were mentioned. I have always used .sh. What is the difference between these different ...
11
votes
2answers
8k views

Make a script/app run on logout

We all know that Mac OS X has the very useful Login Items functionality which lets you, among other things, set up apps/scripts to run when you log in. I'm looking for a way to setup a list of ...
9
votes
4answers
4k views

Getting notified when someone logs into a server using SSH or Remote Desktop

I have a mac mini server running OS X Lion Server 10.7.3. It pretty much runs unattended without problems. However, the server is under constant "attack" according to the logs. The firewall and ...
8
votes
3answers
456 views

Enable/disable Time Machine depending on network connection type

I've not got a great Wi-Fi setup here at home and it sometimes results in failed Time Machine backups. Is there a way of specifying that Time Machine only backs up under certain circumstances - i.e. ...
8
votes
2answers
3k views

Is there a Mac OSX equivalent of zenity?

I'm porting some simple X windows/bash scripts to Mac OSX, but I cannot find a build of Zenity (a Gnome app for basic GUI dialogs) for OSX. Is there some other command line driven dialog utility I can ...
8
votes
6answers
2k views

Create a new (.txt) File in Finder - Keyboard Shortcut

I wanted to know if there is way to set keyboard shortcuts to make new files in Finder. For example, by default, you can create a new folder using CMD+Shift+N. Is there a keyboard shortcut to create a ...
8
votes
1answer
7k views

How do I modify Word 2011 for Mac so I can see tracked changes inline and notes simultaneously?

Background: In Word 2011 for the Mac, it's possible to view tracked changes inline -- that is, see the changes made on the screen within the text itself, as opposed seeing them in a balloon off to ...
7
votes
6answers
7k views

How to send an email from command line?

How to send an email from command line or script? I want to be able to run the script programmatically by passing the receiver and the message.
7
votes
3answers
2k views

Where is my crontab file?

I want to edit my crontab file to schedule a script. Where do I find it?
7
votes
4answers
18k views

How do I execute a bash script that requires root privileges?

I have this script lines from my ISP: sudo bash echo "plugin L2TP.ppp">>/etc/ppp/options echo "l2tpnoipsec">>/etc/ppp/options It works if I paste line by line into Terminal. I want to ...
7
votes
3answers
828 views

Lock screen with LaunchBar

I extensively use Launchbar and have almost all my daily productivity items working through it. Since I use my personal MacBook at work, I do not have use a screen saver password, however, when at ...
7
votes
4answers
5k views

Checking for folder/file changes using Automator?

Is there there a way to check a folder/file for changes (includes adding files, deleting files, changes in files,...). The 'Folder action' in Automator is only checking if any files are newly added.
7
votes
2answers
186 views

How can I run a script when the room brightness has changed?

How can I run a script when the room brightness has changed? In particular I want to run a script when the lights have been turned off in the room that my Macbook is in.
6
votes
3answers
9k views

Are there Greasemonkey scripts for Safari?

There's the wonderful Greasemonkey to run user-defined JavaScript on web pages. Is there such a thing as Greasemonkey for Safari? Or would one instead write a Safari Extension to customize behavior ...
6
votes
1answer
3k views

Turn on Back To My Mac via a Script or Command Line

The VPN software I use for work (IPSecuritas) requires me to turn off Back To My Mac to start it's connection, so I frequently turn off Back To My Mac in order to use my VPN connection (the program ...
6
votes
4answers
368 views

Tools or scripts for tracking a stolen or lost Mac?

Actually I do use the prey project but was wondering about other tools or scripts one could use to find back information about a lost/stolen Mac. With features like: -Getting the ip address or any ...
6
votes
2answers
509 views

What's the easiest way to automate logging into a website?

There's this website I need to access about every ten minutes. And apparently it was designed in 1993, by sadists. There is no "remember me on this computer" checkbox. And if you don't interact with ...
6
votes
3answers
1k views

How to disable individual USB ports by script?

I am looking for a script which will allow me to disable one specific USB port on my Mac mini. It would only serve a purpose if it works in real-time and didn't require a reboot. I've found scripts ...
5
votes
5answers
1k views

OSX Bash for loop - issues with spaces in folder names?

I'm getting a bit confused on how to handle spaces in path names when returned in a for loop. Rationale: I'm cleaning up the permissions on folders and files that I copy over from Windows. Most of ...
5
votes
3answers
327 views

How do I create a Folder Action Script to tar items dropped in folder?

I would like to drop/copy files/folders and have them compressed then copied to my desktop. This is what I know so far... and it isn't much so any help would be appreciated. on adding folder items to ...
5
votes
3answers
2k views

Opening a terminal window to a specific directory from a bash script

How can I write a bash script in Mac OS X that opens a Terminal window in a specific directory? I'd assume something like: open /Applications/Utilities/Terminal.app But that does nothing (maybe ...
5
votes
4answers
3k views

Alternatives to command line unzip?

I've found that the command line unzip tool doesn't gracefully handle some of the files I'm unzipping: it makes a bunch of junk directories, and creates files whose resource forks aren't found. ...
5
votes
2answers
875 views

A programmatic method for disabling all sharing services?

I'm seeking a programmatic method for disabling all the sharing services on a Mac. My preference is for an AppleScript or a shell script. I'd like to have the services shown in the picture below ...
5
votes
3answers
2k views

Programmatically/Script-atically changing the default Open-With setting

Is there a way to change what app opens a file type programmatically/with a script? Basically, sometimes I'm working on a web site, and I want to set all web files to open with a text editor (*.php, ...
5
votes
1answer
16k views

How do I remove a user via single user mode in 10.7?

I occasionally will setup a user's machine that has been in for repair beyond the simple re-install of the OS. For example: install a new hd, install the OS, create a user, install updates and then ...
4
votes
5answers
5k views

Can I download all pictures on a page?

Is there a way I can run a script with a certain web page as the argument that will download all the images from there?
4
votes
2answers
3k views

How can I enable SSH without using the gui or apple script on snow leopard?

A while back here How can I enable internet sharing without using the gui or apple script on snow leopard? I asked if any one knows how to enable Internet sharing without using GUI or apple script, I ...
4
votes
2answers
371 views

Pipe output of grep to a variable

I need to be able to write whether the test for a grep is either TRUE or FALSE to a variable so I can use it later For the following, if I run defaults read com.apple.Finder | grep ...
4
votes
4answers
2k views

Toggle “Use all F1, F2 as standard keys” via script

I toggle the "Use all F1, F2 as standard keys" setting very often and would like to automate it via a script (or a keyboard shortcut). Is it possible? I've tried to Google the right arguments for ...
4
votes
1answer
2k views

How to batch convert word documents to pdf?

Is there a scriptable way that I can convert several MS Word documents to PDF? I thought this might be possible using python, but I am unable to find any advice online on how best to do this.
4
votes
3answers
271 views

App or script to monitor/log processes starting and stopping?

I want to be able to start an app or script, leave it running for a few hours, then come back and see a log of what processes started and stopped in that time. This is not the same as Activity Monitor ...
4
votes
1answer
622 views

How can I automatically download multiple sites through Coda?

I have several sites in Coda that I would like to automatically re-download when I tell it to. The sites are collaboratively managed, and I'd like to download a fresh copy of the sites automatically. ...
4
votes
2answers
259 views

Add and remove multiple tags at once from a file or a folder

Using OS X Mavericks I want to add multiple tags at once to a file or a folder and I also want to remove multiple tags at once. There are different ways to add tags to a file, one of them would be to ...
4
votes
1answer
117 views

Force an app to run one of its menu options from a shell script?

Is there any way to force the App to run one of its menu options if there is no command line interface available? Perhaps an Automation sort of thing? EXAMPLE I would like to run NewsFire's "File > ...
3
votes
5answers
149 views

Shell script help

I am new to writing shell scripts for Unix and need a little help. I am not sure why cURL now all of the sudden after running the script is downloading corrupts packages which cannot be mounted and ...
3
votes
1answer
610 views

What is an alternative to a BAT file on Mac?

What is the alternate for BAT file (Windows) on Mac? Does different version of OS X have different format of BAT files? I am trying to create a BAT file on Mac which normally changes directory while ...
3
votes
3answers
233 views

Shell scripting: Select folder based on part of file name

My project I'm creating a bash shell script to execute from the Terminal. Its purpose is to archive lots and lots of project folders. Each folder follows a prescribed nomenclature: [YYYY.MM.DD] - ...
3
votes
1answer
141 views

Detecting that a script is run within ARD

Does anyone know of a way to detect that a shell script is running within ARD (vs. running the same script locally on the machine)? I looked at detecting that we are running in interactive mode - ...
3
votes
1answer
355 views

Applescript array of applications

I have a script that reload the active tab of an open browser, but I want it to do with all opened browsers. Is there a way to make a list/array and use it in this code? This code works with one ...
3
votes
1answer
990 views

How do I script Powerpoint to save a directory of PPTX files as PDFs?

If I have a directory of PPTX files I would like to save as PDFs. How do I script this operation?
3
votes
1answer
1k views

Is it possible to write a script to change the Energy Saver settings in OS X (10.7.3)?

Basically, whenever I know I'm going to be gone, or if I'm going to sleep, I change the Energy Saver settings in System Preferences in OS X (10.7.3) for Power Adapter to: Computer sleep: 1 min ...
3
votes
3answers
154 views

An automated iTunes?

So I've wanted this for a really long time but I'm not 100% sure how to do it. I basically want to be able to have iTunes play a radio station when I come home. I was thinking of being able to have ...
3
votes
1answer
1k views

Fake.app: How to loop thru the rows in a CSV file and use the data in my Workflow?

I am using Fake to automate some web tasks. I have a CSV file on disk that contains rows of data which I'd like to use to fill out forms in my Fake Workflow. How can I iterate thru the rows in the ...
3
votes
1answer
3k views

how to send scheduled mails with Mail?

I would love to send mails in my apple mail scheduled! What is the most comfortable way to do that? only method i found: http://homepage.mac.com/aamann/Mail_Scripts.html (but this is quite tricky + ...
3
votes
1answer
290 views

Can I make the Finder label a folder if it contains a file or folder of a specific name?

I'd love it if I could somehow make the Finder color-label all folders containing a .git directory so I could tell at a glance if the folder is a Git repo. Any ideas?
3
votes
1answer
525 views

Automator PDF text to Spoken Audio file: What's wrong with this script?

I have pages of PDF notes which I want converted to spoken audio to aid revision. There are several suggested workflows online, but I'm still not getting the results I want. I used this model from ...
3
votes
3answers
3k views

How can I use Terminal to monitor a network interfaces total traffic in Mb

I would like to use the terminal to monitor the network traffic on a given interface, with a view to providing alerts when certain cumulative totals have been exceeded. The script needs to gain ...