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.

Filter by
Sorted by
Tagged with
5 votes
2 answers
2k 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 ...
KG -'s user avatar
  • 663
5 votes
3 answers
3k views

How to check installed OS X version from the command-line on each partition?

I'm managing a lot of Macs and each machines has several partitions with different OS versions. I would like to create a script that I could run to do an inventory of all partitions of all machines ...
icasimpan's user avatar
  • 175
0 votes
1 answer
178 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 ...
Kyle Hayes's user avatar
  • 1,106
3 votes
1 answer
208 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 ...
Joe's user avatar
  • 4,879
2 votes
1 answer
4k 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" "http://...
Stefan Midjich's user avatar
2 votes
1 answer
145 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) ...
Lasse V. Karlsen's user avatar
3 votes
3 answers
3k 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" ...
iolsmit's user avatar
  • 4,435
1 vote
1 answer
372 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 ...
RipperDoc's user avatar
  • 538
2 votes
0 answers
795 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 ...
John's user avatar
  • 83
2 votes
1 answer
3k 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 ...
Kristopher Johnson's user avatar
54 votes
8 answers
55k 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 ...
sh-beta's user avatar
  • 715
3 votes
3 answers
3k 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 ...
staticfloat's user avatar
5 votes
2 answers
77k 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 ...
themirror's user avatar
  • 1,987
8 votes
2 answers
2k 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 ...
Agvorth's user avatar
  • 1,411
8 votes
3 answers
2k 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 ...
BinaryMisfit's user avatar
  • 6,505
4 votes
1 answer
911 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. ...
daviesgeek's user avatar
  • 37.7k
3 votes
3 answers
3k 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 ...
aaandre's user avatar
  • 143
5 votes
3 answers
4k views

What scriptable OCR Software exists on OSX for a paperless office [duplicate]

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 ...
kventil's user avatar
  • 201
30 votes
2 answers
20k 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 ...
daviesgeek's user avatar
  • 37.7k
7 votes
1 answer
25k 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 ...
ivonesh's user avatar
  • 615
1 vote
2 answers
3k 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 ...
Rob's user avatar
  • 11
14 votes
5 answers
16k 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 ...
Nathan Greenstein's user avatar
9 votes
4 answers
18k 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 -...
v3nt's user avatar
  • 639
3 votes
1 answer
2k 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 ...
jsf's user avatar
  • 41
4 votes
3 answers
5k 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 AppleScript? I asked if any one knows how to enable Internet sharing without using GUI or apple script, I still have that ...
Ali's user avatar
  • 1,169
6 votes
3 answers
10k 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 it'...
at01's user avatar
  • 5,485
2 votes
5 answers
833 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 ...
at01's user avatar
  • 5,485
9 votes
1 answer
11k 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 ...
Goodbye Stack Exchange's user avatar
2 votes
2 answers
5k 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?
Ryan's user avatar
  • 857
43 votes
7 answers
94k 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.
michelemarcon's user avatar
1 vote
2 answers
143 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 ...
at01's user avatar
  • 5,485
3 votes
1 answer
4k 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 + ...
Lupo's user avatar
  • 1,229
5 votes
2 answers
2k 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 ...
Jari Keinänen's user avatar
10 votes
4 answers
8k 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, *...
Fake Name's user avatar
  • 5,339
2 votes
1 answer
2k views

Why won't wget work with cron?

I've been using the bashpodder script 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 all. It fails when it has to use ...
cholantesh's user avatar
6 votes
6 answers
15k 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 ...
Kevin Sylvestre's user avatar
6 votes
2 answers
17k 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 ...
Corey Riggle's user avatar
2 votes
2 answers
1k 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).
user avatar
12 votes
5 answers
18k 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 ...
danieldekay's user avatar
71 votes
12 answers
41k 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?
ocodo's user avatar
  • 1,634
9 votes
4 answers
13k 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.
Saneef's user avatar
  • 205
6 votes
4 answers
455 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 ...
HeDinges's user avatar
  • 1,123
1 vote
1 answer
718 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?
Zolomon's user avatar
  • 601
24 votes
4 answers
10k 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 that ...
Reid's user avatar
  • 824
4 votes
1 answer
150 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 > ...
Bleep Bloop's user avatar
11 votes
7 answers
13k 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. (...
Kevin Cantu's user avatar
2 votes
2 answers
2k 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 ...
user avatar
1 vote
1 answer
73 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: ...
Casebash's user avatar
  • 4,293
35 votes
4 answers
31k views

Where is my crontab file?

I want to edit my crontab file to schedule a script. Where do I find it?
Casebash's user avatar
  • 4,293
9 votes
1 answer
6k 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 ...
Chealion's user avatar
  • 7,888

1
11 12 13 14
15