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)

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 ...
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
4k 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 ...
5
votes
2answers
899 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 ...
0
votes
1answer
132 views

How can I make a keyboard configuration become default when I hook it up?

At work, I have a MacBook Pro and a RHEL workstation that share a HP keyboard and mouse via a KVM switch. I do most of my work on the Mac so I prefer to change the modifier keys so they command and ...
2
votes
1answer
90 views

'script' command in terminal, looking for a flush open

When I use 'script' on a unix terminal the -f option flushes the data straight to the file - from the man page "-f Flush output after each write. This is nice for telecooperation: One person does ...
1
vote
1answer
1k views

How to make a LaunchAgent with StartCalendarInterval

I want to start replacing crontabs with LaunchAgents. My first attempt is not working. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ...
2
votes
1answer
116 views

Start program in response to system events (like ip address changes, etc.)?

I want to start a program in response to system events, such as: IP address changes WIFI connectivity changes (whether I'm connected, and/or which network I'm connected to) Volume (as in disk) ...
1
vote
2answers
962 views

What is your preferred way to start a (shell) script from the GUI?

I was wondering what ways there are to start a (shell) script from the GUI, e.g. double-clicking an icon in Finder or launching via Spotlight. This is not about opening a terminal and "manually" ...
1
vote
1answer
211 views

How can I regularly move movies in iTunes to an external drive?

I have been adding a lot of movies to iTunes lately. Problem is, the size grows very quickly. I appreciate having the metadata in one place, but I would want to move the actual files to an external ...
2
votes
0answers
654 views

With Lion, Problems Accessing Shared NTFS Folders with SMB://

We are testing a local login script that we created for our Macintosh users on Lion. It has worked fine on all OS X versions prior to 10.7. Listed below is the script that we are using. When we run ...
2
votes
1answer
965 views

How Can I Restart in Windows Using a Script?

I'd like to be able to reboot into the Boot Camp partition without needing to go change the Startup Disk in System Preferences or holding down the Option key at startup. After reading some stuff on ...
20
votes
5answers
12k 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 ...
2
votes
3answers
1k views

Inserting shell script into .app bundle

I'm trying to shoe-horn a shell script into an application bundle so that the shell script will be run when I open the bundle, as opposed to the executable put in there. Specifically, I'm trying to ...
3
votes
2answers
15k views

Can I use my iPhone as a “remote” for my iPad?

iPhones and iPads both have several apps aimed to be remotes for the PC/Mac -- mostly geared towards specific apps. That's not what I'm asking about. I'm interested in any way of using my iPad and ...
6
votes
2answers
525 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 ...
7
votes
3answers
843 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 ...
4
votes
1answer
635 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. ...
3
votes
3answers
1k views

An app or script to watch folder and display new images in full screen?

I'm teaching a photography class and would like to use a cheap setup to display photos taken by the students in real time. I have a macbook pro and an iphone. I also have an eye-fi card but it's an ...
3
votes
1answer
1k views

What scriptable OCR Software exists on OSX for a paperless office

I'm planning to get a paperless office and for that, I a need good scriptable piece of OCR for OS X? I've read a blogpost by Marco Arment about a few programs. Are there any workable ones there that ...
12
votes
2answers
5k 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 ...
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 ...
1
vote
2answers
695 views

find video codec from terminal

I'm writing some shell scripts that automatically convert some video files. Except I don't want to run the conversion on files that are already h264 encoded. Is there a way I can tell via a terminal ...
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 ...
2
votes
4answers
3k views

os x terminal -remove files older than x days

trying to create a scripts that deletes files older than X days. It seemed straight forward enough but all files seem to be getting removed? find /Volumes/Groups/Projects/530_BFAMI/test/ -ctime +30 ...
2
votes
1answer
1k views

How to: Create a playlist with full albums for which one (or more) of its contained tracks has a 5 star rating?

I am looking for a tool/script/javascript to run within windows against my iTunes database that will produce a playlist of "all albums for which I have given five stars to any one song." I can easily ...
4
votes
3answers
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 ...
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 ...
1
vote
5answers
455 views

opening an app in a shell script with sudo

I'm trying to open an app that listens to port 25 within a shell script. In order to listen to port 25, I need to run the app with sudo. So I tried the following: sudo open appThatNeedsPort25 It ...
8
votes
1answer
8k 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 ...
2
votes
2answers
2k views

Automatically press a key every 60 seconds

Is it possible via Automator, an app, applescript, etc. to automatically press a key (i.e. "g") every 60 seconds?
7
votes
6answers
8k 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.
1
vote
2answers
117 views

Scripting environment setup

When I start a session programming on my macbook pro, I have a bunch of apps I'd like open and ready: DevNull smtp java server (run from terminal with java -jar DevNull.jar) Terminal shell 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
549 views

Why setting image as its own icon with sips result a blurred icon? Are there any alternatives?

I've successfully changed icons using the procedure described in an another question: Changing or setting a file or folder icon programmatically. Either my sips (or Finder) got broken afterwards or I ...
5
votes
3answers
3k 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, ...
2
votes
1answer
980 views

Why won't wget work with cron?

I've been using the bashpodder script (http://lincgeek.org/bashpodder/) recently, and while the script works beautifully when I use it in the command line, the crontab I created for it doesn't work at ...
2
votes
6answers
2k views

Center Window on Screen

I'm creating a few screen casts and wanted to exactly center my windows in my screen. Any good way to do this on the Mac? I found an Apple Script example (and a few linked screens) but none of them ...
0
votes
2answers
7k views

Automator choose finder folder and run shell script

I've got a simple shell script that I would like to incorporate into an automator workflow. I just need to double click the application , pick a finder folder and run the command. At the moment it is ...
1
vote
2answers
764 views

How do I use a keyboard shortcut to execute a shell script I wrote, passing the file selected in Finder as an arg?

I suppose you could have it pass in whatever was selected in general in any app (such as text highlighted in a web browser).
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 ...
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?
7
votes
4answers
6k 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.
6
votes
4answers
369 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 ...
1
vote
1answer
456 views

Using select.kqueue() to tell when file is modified in python?

How can I use select.kqueue() to find out when a file in a folder has been modified?
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 ...
4
votes
1answer
118 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 > ...
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. ...
2
votes
2answers
941 views

Command Line method to backup using two Time Machine disks

Does anyone know of a command line method to select the active Time Machine disk? I would like to alternate between two backup disks for redundancy. I would like this to be automated, presumably via ...
1
vote
1answer
58 views

Script doesn't find file

Suppose my_folder contains my_script and my_program. my_script tries to run ./my_program -myoptions. It works when I cd into the directory, but not when I double click on it. Here is the output: ...