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)

0
votes
2answers
4k views

line 1: syntax error near unexpected token `newline' with HTML + shell script

I've been learning the shell with a great tutorial, linuxcommand.org. After a lot of learning and practice with navigating directories, editing files, etc, I've moved on to writing shell scripts. One ...
1
vote
0answers
158 views

How can I detect and remount my time machine sparsebundle?

I currently have my Time Machine sparse bundle residing on a network drive plugged in to my router. I have a script that runs at login that auto connects to the shared drive and mounts the ...
2
votes
2answers
314 views

How do I get Automator to process images using ImageMagick in a command script?

I'm making an Automator workflow that uses the shell script action to process a selection of images with the imagemagick composite command. Only I'm having issues getting it going. According to the ...
1
vote
0answers
161 views

How to detect locked screen / login-session from a script?

I am looking a way for a script (either bash or AppleScript, doesn't matter) to detect whether the state of the screen or the user login session is locked or not (i.e. the user will need to type in ...
8
votes
3answers
462 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. ...
5
votes
3answers
330 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 ...
0
votes
3answers
3k views

How to persistently define aliases in Terminal

I want to add aliases to my environment so that they are available in all Terminal instances. I got this answer: Yes, you can put it in your .bashrc, .bash_profile or .profile. On some systems ...
1
vote
2answers
614 views

How can I import a .terminal file using the command line?

I'm writing a (Bash) script to automate setting up my Mac environment and would like to do this, except using the command line only. I'd also like to make that theme the default. I have a .terminal ...
0
votes
2answers
34 views

Determine the location of a shared folder in Win7

I am now using Mac OS 10.8, and want to write a script (.sh) to copy some files from Mac to the shared folder of a Win7 computer. I can access the Win7 computer shared folder via Finder, but I do not ...
0
votes
1answer
2k views

Automator won't execute my bash shell script

I have a bash script that works like a thread. Now I'd like to turn it into a service with Automator. Input is set to Image Files in Automator and the shell script action is set to Pass input as ...
0
votes
1answer
137 views

Simple Script for URI Handling

Basically what I'd like to know is how can I setup a shell script (or an Applescript or Automator wrapper for a shell script) as a protocol handler for a custom URI (so clicking them will trigger my ...
1
vote
1answer
38 views

Can two apps be tied so that when one opens or closes, the other does so?

Can triggers be set up so that when "App A" starts, another "App B" gets started automatically? Ideally, the solution would send a quit message to "App B" when "App A" quits, but the important part is ...
1
vote
1answer
346 views

Automator to execute shell script with an input text file, copy it to specific directory

I'm simplifying making a .deb file with Automator. I currently have a shell script that does some simple actions - Ask the user for text input Do some directory parsing Execute a command with the ...
2
votes
2answers
880 views

My Automator Workflow fails because it fails to find the git command within the 'Run Shell Script' command? Need help

I have an Automator workflow and one of the actions is to clone a repository. Here's the code for the 'Run Shell Script' action. The command is run within the Bash shell /bin/bash if that matters: ...
0
votes
0answers
14 views

How do I use Mathias .osx defaults? [duplicate]

I just got a mac and am still familiarizing myself with it. I was taking a look at: https://github.com/mathiasbynens/dotfiles/blob/master/.osx Not sure how to use it!
1
vote
1answer
130 views

Export or list system settings that deviate from defaults

I am looking to generate something similar to this osx settings script. I'm not having any luck finding ways to perform a diff between system defaults and my customized settings. Anyone know of a ...
2
votes
1answer
305 views

How do I use say command creatively to prank my coworkers/friends?

I'm designing a creative / funny prank for OSX via command line. By running in the background, most users would not notice it when she/he first starts using the computer. Using say command with ...
1
vote
1answer
238 views

Automator Service with Google Translate

I set up an Automator Service that receives selected text and then runs a simple shell script to pass the text to open google translate: open https://translate.google.com/#auto/en/"$@" It opens ...
1
vote
2answers
99 views

Is there a user-friendly app that can create an archive of system.log files and the like?

Background I have this command to create a temporary collection of selected log files – sudo tar -czf $TMPDIR/archive\ of\ install.log\ and\ system.log\ files\ only.tgz ...
0
votes
1answer
1k views

Terminal bash commands stopped working

I was trying to install some stuff for scala development on my MAC, and probably I managed broke the shell/terminal while I was mindlessly running some scripts that I don't know. Now when I start the ...
2
votes
1answer
106 views

extract to a new folder with spl name

working on OS X 10.8.3, have part of what I want working, hoping for help with the rest #!/bin/bash # script accepts a path to base dir - base path to extract # also accepts second param - archive ...
-2
votes
1answer
2k views

How to configure Automator to log into a website, each time generating a new random UID and email address?

I need to find a way to log into a company intranet site multiple times in quick succession on OS X 10.8.2, each time with a new completely random user ID and email address. The website only requires ...
1
vote
2answers
624 views

Scripting on iPad - accessing features like accelerometer, GPS, etc

Are there any scripting languages for the iPad that can access native functionality like accelerometer, GPS, text messages, etc? I know that it is possible to write Scheme and Python scripts but I ...
1
vote
1answer
385 views

How to create an apple script that forwards a flagged email

I want to create an apple script that will forward a flagged email to x@mail.asana.com I have tried this script: on run tell application "Mail" repeat with _acct in imap accounts ...
0
votes
1answer
68 views

Show When Applications Were Opened and Closed

I'd like to be able to see a list of applications that were recently opened and quitted on a per user basis. Ex: 19:25:34 Google Chrome Canary opened by John Smith 20:45:32 Pages quitted by Julie ...
1
vote
2answers
280 views

Need Help with an Applescript / plist

This has been a learning experience for me. Everything checks out logically to me in this script/ plist but something isn't correct. Everything runs, but then the script runs every minute which is ...
0
votes
1answer
37 views

Is it possible to show custom icons in the Scripts menu?

You know that "scripts" menu you can show in the right side of the menu bar? It's very useful. I'm talking about this menu: I've set some custom icons for the files in the scripts folder using the ...
1
vote
1answer
374 views

Run script on networked user login

The computer lab is running 10.8. I would like to run a script when networked users login. As far as I can tell my choices are: launchd agents - Not meant for this. On the launchd.plist man page it ...
2
votes
3answers
2k views

Find/Unrar/Delete Script

I'm a PC convert, and quite novice when it comes to shell/bash scripting, but I really want to learn/understand more. My need: I need to be able to scan a folder, find any .rar files, extract the ...
2
votes
0answers
169 views

Can I use the Terminal to find all OpenMeta tags on my system?

I know that there are apps that can do this, so I figure it must be possible: I'd like to compile a list of every OpenMeta tag that I've used on my Mac (OS X 10.8.3). But here's the rub: I'd ideally ...
2
votes
1answer
84 views

How to implement this script on a Mac

I just read Matt Might's blog post on eliminating filler and "weasels" from my writing, and I am wondering how I would implement this on Latex to run and check my document? I know I should use ...
1
vote
2answers
118 views

Is there such an app or script that automatically logs off a user after a given number of minutes of activity?

I am looking for information on either an app or script that logs off an account after a certain number of minutes. I know this can be done by default after X amount of inactivity. However, I am using ...
0
votes
1answer
142 views

File path to file on Mac Mini via LAN

I have a bunch of data files on a Mac Mini that I want to read over my wireless LAN in a script (F#, not that it matters I think). I can see the files in Finder, but don't know how to read them in a ...
1
vote
2answers
1k views

How to Run Shell Script upon Application Launch?

Not sure if this belongs here or on SuperUser, but it's Mac specific, so I'll go with here. I wrote a Ruby script that edits TextMate's global properties file and changes the theme based on the time ...
2
votes
3answers
1k views

How to determine the absolute path to a file in a shell script

I am writing a generic script that can get passed both absolute and relative (to the current working dir) paths to existing files. I need a fail-safe way to turn all those passed paths into absolute ...
1
vote
2answers
292 views

How can Growl trigger an shell script or AppleScript (NOT vice versa!)

When a Growl notification gets issued I want to trigger an AppleScript. I had a look at the "Actions" in the Growl preferences, and you can trigger things like an email or a text-to-speech call, but ...
2
votes
2answers
386 views

Using cURL to download images in XML feed?

I have an XML file that has links to various .jpg I want to create an applescript that downloads a local copy of these. The idea is to also label them sequentially with a number say 001 to 030. ...
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.
2
votes
1answer
58 views

Sharing settings report (security audit)

I am new to Mac administration and struggling somewhat on how to programatically report in the settings in the Sharing Preference panel (10.7 and 10.8). Basically - I want to report in which settings ...
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?
1
vote
0answers
329 views

How can I create (nested) Keynote.app slides from a XML file?

I have some nested lists (XML/OPML file) and I am looking for a (automated) process to create Keynote presentations from them. Use case: I write concepts for presentations in an Outliner, then would ...
1
vote
2answers
127 views

Monitor Console.app for a string and notify when found

Is it possible to monitor all messages in Console.app for a string and then notify the user when this string occurs? I have the problem that I'm getting disk I/O errors and I suspect that it's not a ...
0
votes
2answers
321 views

Applescript to update year tag for audio files

I have a lot of tracks in iTunes where the files are named "music-NNNN.mp3" with NNNN being the year the track was recorded. How can I use Applescript to automatically set the year tag for these files ...
3
votes
1answer
142 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
429 views

Batch update the birthdays in my iPhone contacts

Years ago when I got my first iPhone, AT&T transferred all of the contacts from my old phone. My old phone didn't have a birthday field in the contacts. Instead of leaving the field empty on the ...
2
votes
1answer
2k views

How can I open Google Chrome in Presentation mode using a shell script

Previously in 10.6.8, I was able to start Google using open /Applications/Chrome.app --args --kiosk http://www.google.com Now, on newer systems, that does not work anymore correctly. The only way to ...
0
votes
1answer
95 views

Organizing skype downloads in subfolders with contact names

I always wondered why skype don't put all my accepted downloads in subfolders with the name of my contacts! If anybody have own solutions, share)
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 ...
2
votes
1answer
172 views

Running actions when I disconnect external monitor

I would love to auto start Bartender (by the way, excellent app that hides some of your notification area icons) when I unplug my external monitor from my Mac. Is there any app or script that could ...
1
vote
2answers
2k views

Display dialog from command line (like xmessage does)

Background I'd like to be able to display a notification window in OS X from within a script. The script will be running in background, so the notification should not go to the terminal but instead ...