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)

2
votes
2answers
4k views

Way to logout a user from the command line in OS X 10.9

I want to logout my Mac OS X from the command line. My OS X version is 10.9. I tried command pkill -KILL -u uid, but this command didn't work out. Is there a command that can be used to log out a user ...
1
vote
1answer
72 views

skill -KILL -u $user Command on Max OS X?

Is there an alternative for the skill -KILL -u $user command on the Mac OSx. The basic requirement is I want to log out my current logged in user at end of shell script This program logs out Linux ...
1
vote
0answers
24 views

Logs for checking establishment and disconnect of mac user remotely

I am using Vine VNC Server in Mac OS X for accessing my desktop remotely. I want to fire two scripts: One at establishment of the VNC connection One at disconnection of the VNC connection I ...
0
votes
1answer
265 views

how to use terminal to remove item from dock

Hi I have a shell script in my login item , which runs whenever i log in to my system . It does work completely but once it exits the terminal , it leaves the terminal shortcut on my dock and I don't ...
1
vote
1answer
1k views

How to make a playable DVD iso from a VIDEO_TS folder?

I used to have a script that converts a VIDEO_TS folder into an ISO that plays ok in VLC but it's gone. Anyway, this command gets me most of the way there: hdiutil makehybrid -udf -udf-volume-name ...
1
vote
1answer
40 views

Delete folder with specific condition

I need a script to delete a folder, only if the folder does not contain media files with extension avi or mp4.
1
vote
1answer
21 views

Where are the actions stored that the Contacts.app can apply on telephone numbers?

When I click on a telephone number in Contacts.app (or more precise: on the word left of it) I get to see the following menu: Where does Contact.app store these actions? I couldn't find anything in ...
1
vote
2answers
118 views

How can you set up a free, universal OS X-wide ‘autosave’ script?

I want to set up a free solution in OS X for a universal ‘autosave’ function (given Apple’s own solution is limited to only a few apps - at least for now), and let Dropbox do my file versioning and ...
0
votes
0answers
29 views

What scripting framework could work with google translate for a non-programmer?

So I want to create a small workflow that I can integrate into my OS that does this: Translate selected sentence with google translate (fixed languages) and make it automatically get pasted where I ...
1
vote
2answers
34 views

Keyboard shortcut to CLI executable

I have a couple CLI utilities I would like to map to key combinations. The scripts take no parameters, I merely need to invoke them. I've seen how to create keyboard shortcuts to apps, but can I ...
0
votes
1answer
203 views

Move files to individual folders, using file name as folder naming convention for folder, using Terminal

I've been looking for answer on the web now for a few hours and can't find what im looking for. What i want to do is move each file in a directory to a new folder using the name of the file, excluding ...
1
vote
1answer
52 views

How to script a logout while screen is locked?

I want to log out a user via a shell script, after a delay. However, there's a few other issues: User does not have admin and/or root. Logout must complete even if screen is locked. Currently, I'm ...
0
votes
0answers
23 views

Automatically copy PDF.plugin to Chromium.app

I'm using Chromatic.app to update my Chromium.app recently. I'd like to use Chrome.app's PDF.plugin in Chromium.app. Therefore I need to copy PDF.plugin to the following directory: ...
2
votes
2answers
348 views

Does Mac OS X's bash read scripts for all users (tab-completion scripts) from /opt/local/etc/bash_completion.d path?

I stumbled upon some instructions in the book "Pro Git" It suggests: Download this file : https://github.com/git/git/blob/master/contrib/completion/git-completion.bash If you use the Bash ...
0
votes
1answer
106 views

What is the proper way to use the cut command on ps command output

This question is related to a question I posted on rogue firefox procesess. It relates to firefox processes following image uploads that I have been having for a while. I am trying to get to the ...
0
votes
2answers
237 views

script copy sender(s) email address only to the clipboard

I am a blind voiceover user of mac. The new Mail.app makes it difficult to copy the sender's email. I would like to have a script which copies the sender email only, of one or more selected ...
1
vote
1answer
235 views

OS X application start/stop hook

How can I have a script automatically ran when I start or stop an app without using 3rd party tools? I'm not developing the application myself, it's a general question that applies to any installed ...
-1
votes
1answer
39 views

Seeking shell-scripting resources for the visual learner

I'm trying to teach myself shell scripting. I understand things best when I see them in the context of a system, especially when I can visualize that system. I'm looking for a visual companion to ...
1
vote
0answers
68 views

Correct Way to Check if Spotlight Has Indexed a Folder's Contents

Okay, so I've written a script that uses mdfind to more quickly match files, however, I need to find the best way to check whether a target directory is indexed or not, so I can fall back to using ...
1
vote
2answers
53 views

Forcing a script to run in english

My Mac is running Mavericks in English, but because my region is set to Portugal and my keyboard is the portuguese one, when I run some scripts they shows messages in portuguese. I generally hate to ...
1
vote
1answer
751 views

Setting a firmware password

Currently trying to use a script (preferably shell) to setup the firmware password on a fresh OSX install. I obviously found this: http://osxdaily.com/2014/01/06/set-firmware-password-mac/ which ...
2
votes
5answers
2k views

How to launch browser in iOS Simulator from command line?

I want to launch the browser in iOS Simulator from the Terminal with specified URL. Is there any command for it? So that I can write in a script which will take URL as argument and launch simulator ...
2
votes
3answers
335 views

Running a bunch of commands in Terminal

I run the following commands for logkext a lot in my terminal and would like a know a way to automate the whole process. Open terminal type "sudo logKextClient" Type in administrator password ...
2
votes
1answer
86 views

Execute Shell Scrip individually for each selected file in Finder

I am trying to create an automator workflow that will do a google search for the filename of each selected file in finder. Unfortunately the workflow I have created works just with one selected ...
1
vote
0answers
48 views

How to change audio output according to display state?

I've got a Mac Mini connected to a TV via HDMI. I would like to have the audio output device changed automatically to external speakers if the TV is turned off. I can imagine that this feature is not ...
0
votes
0answers
13 views

Is it possible to send a badge notification to an arbitrary application (as if from a shell script)?

I'm still not sure how I'd keep track of it (the API makes it seem like you can't just say "add 1 to the current number"), but is this even possible? I thought terminal-notifier have such an option, ...
0
votes
0answers
91 views

Notification message's delay before hide

I made a script to upload images, it shows a notification, but it stays on screen for a very long time until I close it by click. Is there a way to decrease the delay for this notification?
1
vote
2answers
188 views

How to make a message appear on the screen?

I'm trying to set up a kind of intercom system between Mac, Windows, and Linux boxes at home. Question: How can I make an arbitrary message appear on the graphical screen of Mac OS X? For instance, ...
2
votes
1answer
6k views

Full privileges on .command file, but it says I don't have appropriate privileges

I have a command that I regularly need to run in the Terminal (for application code signing). Normally I launch the Terminal, press the up arrow until I reach the command I want, and then hit enter. ...
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 ...
1
vote
3answers
11k views

How Do I Use 'cp' to Overwrite Files?

Using a shell script or Terminal, how do I overwrite files that may or may not be present. I looked at man page for cp, it said use the -f argument to force overwrite. But, it does nothing. $ cp -f ...
0
votes
1answer
322 views

How do I create a script to create/modify local admin accounts?

This question is almost exactly what I need for my project at work. We have approx. 400 Macs on our campus, and the problem is they were not all set up identically. There are at least 4 different ...
7
votes
2answers
188 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.
0
votes
0answers
34 views

Log time and battery percentage on charger disconnect

Is there any way to create an event or a script that will log the current time and battery percentage each time the charger is connected or disconnected?
1
vote
2answers
791 views

Hidden login script

I have a bash shell script that runs on login. Even though I selected the "hide" checkbox in system preferences, iTerm still shows while running it. How do I completely hide it?
0
votes
0answers
97 views

How can I open a URL on connecting to a specific wifi network in OS X?

Some wifi networks require logging in through a browser after connecting, in order to gain internet access. In many cases it is possible to log in by opening a specific URL without having to click ...
0
votes
1answer
26 views

Change Modifier Key While Application is frontmost

What I'm trying to accomplish is to intercept or change Command and replace it with Control for use while another application is running and frontmost. Is there a way to temporarily change modifier ...
1
vote
1answer
228 views

Unable to create a working .app executable using Platypus

I'm new to OS X and I'm trying to create an application wrapper for a shell script that starts a media server(Red5) I'm trying to wrap the Red5 server starter script (red5.sh) into an .app executable ...
2
votes
0answers
183 views

How to run a shell script upon user authentication (e.g. screen unlock)?

I would like to specify a shell script (say one to send me an email) whenever a given user is authenticated, for example if prompted after sleep, fresh login or fast user switching. PS: I found ...
2
votes
1answer
943 views

Trouble in Automator's Shell Script after OS X 10.9 Mavericks upgrade

I've got a problem. I use from lot of time an Automator's shell script: cat >> ~/Dropbox/ClipBoard/Appunti\ Mac\ del\ $(date +\%Y-\%m-\%d).txt It ever worked but, after Mavericks upgrade, ...
0
votes
1answer
133 views

SIPS: Only Resize if Image is 315x300?

I'm currently using sips --resampleHeightWidth 250 300 "S1" to resize new images in a folder but I think that it might be resizing images that were already resized.. Is there anyway to know this for ...
2
votes
2answers
945 views

Run script before restart/shutdown

Is it possible to execute a script/command right before OS X is shutting down or restarting? I'd like to run sudo apachectl stop to stop apache from auto-starting.
0
votes
2answers
266 views

Cross-Platform alternative to expr length

When running some BASH scripts I had in my Linux box I noticed that expr length gives syntax error. Manual pages doesn't seems to include any information about the length operator. Is it missing in ...
0
votes
1answer
213 views

Which background processes can I disable to speed up my Mac

If I'm on an old Mac and I just want the basics (web browsing, text editing, multitasking) to run a lot faster and I don't mind losing out on bells and whistles or temporarily disabling unneeded ...
0
votes
1answer
453 views

Start screensaver/ lock screen on screen sharing disconnect

Is there a way with an AppleScript or shell script to start the screensaver when you disconnect from a screen sharing session? For example, I connect via screen sharing from Mac A to Mac B. When I ...
0
votes
1answer
76 views

Share shell script: file permissions question

I'm on Mountain Lion 10.8.5 and recently I've made a small shell script which just shows a message on the screen. To run it, I had run chmod +x test-script.sh and then using sh ./test-script.sh ran ...
0
votes
3answers
379 views

Run applescript as a service

I have the following applescript bundled as .app (using Platypus) and starting on user logon (12.4 MB for each user) #!/usr/bin/osascript -- INICIO DAS FUNCOES EXTRAS set app_path to path to current ...
1
vote
2answers
138 views

My Launch Daemon doesn't work despite returning a 0 status

For some reason, the launch daemon I created will not run successfully at system boot. I have tried it as a launch agent but that also doesn't work. This is my plist located in ...
4
votes
2answers
374 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 ...
1
vote
0answers
132 views

Script to make the x red button kill the app

Quick background: new mac, long time windows user; not scared by linux and scripts. I am currently using RedQuits to make the x red button quit de app, not just close the window. It is a great ...