Questions tagged [script]

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.

742 questions
71
votes
12 answers

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?
ocodo
  • 1,634
  • 1
  • 21
  • 23
54
votes
8 answers

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 MacBook and iMac. I rarely shut down my MBP since…
sh-beta
  • 715
  • 1
  • 6
  • 6
51
votes
3 answers

Do Terminal processes stop if Mac sleeps?

I'm running some Python machine learning programs through Terminal that take hours at a time to finish. If I leave my computer unattended it hibernates - the screen goes off and I have to type in my password again. When this happens, does my script…
Nicholas Hassan
  • 613
  • 1
  • 5
  • 5
43
votes
10 answers

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 from the system using command line only, not…
prateeak ojha
  • 885
  • 3
  • 11
  • 15
43
votes
7 answers

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.
michelemarcon
  • 669
  • 2
  • 6
  • 7
36
votes
6 answers

Auto-updating Homebrew

i'm currently using the Homebrew package manager and my question is: is possibile to write a bash's script in order to execute brew update and eventually brew upgrade whenever opening a shell for the first time? I'm using iTerm at the moment.
g_rmz
  • 533
  • 1
  • 4
  • 10
35
votes
7 answers

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 defaults write ... but unsuccessfully. Update: I…
Jakub Roztocil
  • 967
  • 1
  • 10
  • 19
35
votes
4 answers

Where is my crontab file?

I want to edit my crontab file to schedule a script. Where do I find it?
Casebash
  • 4,273
  • 15
  • 45
  • 60
32
votes
5 answers

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: SOURCEDIR="${3/\/Volumes/}" cd…
racl101
  • 443
  • 1
  • 5
  • 6
31
votes
10 answers

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 new text file? I'm a programmer so this would be…
Harry
  • 589
  • 1
  • 5
  • 10
30
votes
2 answers

How to create a universal (script) file for a Mac, based on several Terminal commands

I have several Terminal commands I use for troubleshooting purposes, by typing them in one by one into the terminal window. These commands require the user's password to be entered. I'm looking for a way to create a universal (script) file with…
0lesya
  • 355
  • 1
  • 3
  • 9
30
votes
2 answers

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 scripts? Do some extensions allow for different…
daviesgeek
  • 37,296
  • 51
  • 158
  • 200
24
votes
4 answers

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 that asking for executable "foo" automatically uses…
Reid
  • 824
  • 2
  • 9
  • 21
24
votes
1 answer

Passing arguments to 'Run Shell Script' in Automator

I want to make an Automator workflow to run a shell command. For example, I want to receive text input from the user and treat that input as a shell command instead of text. I have tried passing argument as stdin but still not able to make it work.…
Ameer Hamza
  • 343
  • 1
  • 2
  • 8
24
votes
1 answer

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. I've decided that a more sustainable solution…
Thunderforge
  • 1,963
  • 8
  • 27
  • 38
1
2 3
49 50