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
0answers
14 views

Scripting the Disabling of Network Logins Mac OS X

I am attempting to add the ability disable the network login ability on our Macs (running 10.10.5) to my post-image script. That’s System Preferences --> Users & Groups --> Login Options --> ...
0
votes
0answers
7 views

How can I trigger the download of an iTunes iCloud song with a COM script on Windows?

iTunes 12.4 for OS X/macOS allows downloading of iCloud content via the AppleScript command download. The iTunes COM SDK for Windows does not seem to offer anything comparable. The next best thing ...
0
votes
0answers
12 views

Why is this AppleScript idle timer not triggering correctly?

I am trying to create a timer that increments at a certain time (in this case, whenever the time is xx:03:24) and sends a notification when it reaches a user-inputted value. Once it does so, it resets ...
1
vote
0answers
20 views

Is there an app to replace in bulk an area of a PDF with a preset image?

I have several PDF documents that follow the same template. In all of them there is an address that needs to be replaced with another. I'm looking for a way to do that in bulk and automagically.
0
votes
0answers
16 views

Warning when starting script with osascript within script

scriptName.sh contains the following code. osascript <<EOD (display dialog "To: $name $number \n $sentence" ¬ with title "Message" ¬ buttons {"Send", "ReDo", "...
0
votes
1answer
17 views

Collecting All Clients logs every night

We have a financial institution we are bring on as a client running on Mac's. The are looking to collect all the system logs from each computer every night and keep each for 90 days. I have seen ...
17
votes
3answers
7k views

Where is my crontab file?

I want to edit my crontab file to schedule a script. Where do I find it?
0
votes
2answers
86 views

Dtrace script newproc.d stopped working after upgrade, because of missing proc:::exec-success probe

I'm trying to run: $ sudo /usr/bin/newproc.d which suppose to snoop new processes as they are executed, but it fails with the error: dtrace: failed to compile script /usr/bin/newproc.d: line 22:...
0
votes
0answers
33 views

AppleScripts move files with ‘System Events’ instead of ‘Finder'

When using Finder, script can take much longer. I also want this script to work on the background. How can I use System Events instead of Finder in this script? property source_folder_one : alias "OS ...
1
vote
0answers
180 views

AppleScript to automatically update IP-adress in Remote Desktop (ARD) on computers with DDNS

I've been searching for hours but couldn't find an answer yet hence my question here. I frequently use Apple Remote Desktop (ARD) and I have setup a DDNS for every computer. The only problem I have ...
0
votes
0answers
32 views

Disable idle sleep within a shell script

How can I use caffeinate or pmset within a shell script to prevent my laptop from sleeping and interrupting the script? Something like: #!/usr/bin/env bash # disable idle sleep # rsync ... # more ...
0
votes
0answers
13 views

Double click on keypress macro

What is the simplest way to assign a key to trigger a double click of the mouse? And even better if holding down the key would perform multiple double clicks. Free or open source or script preferable.
1
vote
1answer
87 views

Use script without root

I write a maintenance script with different commands. the script has sudo commands inside. Now I want to use crontab, but my first problem is: How can I use the script on user level without root ...
1
vote
0answers
34 views

'Add notes' to a Calendar event using Automator

I would like to build a 'Service' for selected text which: Get the currently selected text Creates an Calendar event adds the selected text as a 'note' for that Calendar event I prefer Automator ...
3
votes
2answers
73 views

How can I get the dev name associated to a Volume name?

I am creating a bash script to unmount my usb drive after the backup is done. To unmount the drive I use the command: diskutil unmount disk4s1 But sometimes when I plug my usb drive it gets a ...
0
votes
1answer
35 views

What automatic script runs with Bourne Shell (/bin/sh) for root?

I want to add some aliases to my OSX command line environment for easier navigation when in the root prompt (sudo su to root). On the Bourne Again Shell (/bin/bash), I can edit /var/root/.bash_profile....
1
vote
1answer
40 views

OSX Unmount usb disk drive from Automator bash script

I have a task in automator to make my backup, it runs shell script code, lot of code is working well but the unmount command doesn't works, I don't get unmount the unit after backup. I checked to run ...
4
votes
1answer
136 views

How to access GPS data from command line on jailbroken iPhone

Are there any binaries available via the command line to get information from the GPS on a jail broken iPhone? I've searched through Cydia and haven't found anything, but I wouldn't imagine this ...
5
votes
2answers
1k views

Script to change Computername/hostname causing bizarre Terminal behavior

I have a script (mostly borrowed) which utilizes scutil to rename computers based off of values in a CSV file. It matches the serial number to a computer name, sets a variable, and then renames the ...
0
votes
1answer
35 views

Finding file in parent folder of an AppleScript

I have an AppleScript that calls another script (a perl script in this case) which resides in the same folder as the AppleScript. Now I'm trying to put the script into a variable like this: tell ...
3
votes
2answers
945 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 ...
37
votes
8answers
15k 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?
0
votes
0answers
18 views

Detect if iPhone trusts this computer

I'm working on a script that automates import photos from iPhone in Mac Photos.app How can I find out if iPhone trusts this mac? I've tried system_profiler SPUSBDataType and ioreg -lp IOUSB but ...
0
votes
1answer
45 views

Send notification from command line [duplicate]

On Mac OS X, some applications will display a notification that appears briefly in the upper-right corner (e.g., when I receive email). Is there a way to generate a notification from the command-line?...
1
vote
3answers
63 views

How can I apply a terminal script using ssh to all users?

I need to disable Google chrome's print preview option using the script "defaults write com.google.Chrome DisablePrintPreview -boolean true -contributed by CutMaster", to a mac using ssh and apply ...
0
votes
1answer
31 views

Is it possible to create a service using only the shell and bypassing automator altogether?

Using automator is somewhat of a tedious task. Using the shell in the Terminal is much easier all around. Even using the "Run Shell Script" action inside automator is not the same as using the actual ...
0
votes
3answers
57 views

Easiest way to get path of currently-opened file in Adobe Acrobat?

When viewing a file in Adobe Acrobat Pro XI on OSX Yosemite, I sometimes want to send the file to another application. To create an action in KeyboardMaestro, I need to get the path of the currently-...
0
votes
1answer
15 views

Duplicate calendar events in Outlook 2011

Does someone have a script to merge or delete Outlook 2011 duplicate calendar entries?
0
votes
0answers
32 views

Live Photos Metadata

I've been trying to transition from Apple Photos to a plain folder tree (and then use dropbox). For this to be useful, one needs a good naming scheme. I did a bit of googling and using Hazel seems ...
11
votes
6answers
6k views

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 ...
-1
votes
1answer
20 views

Backing up data

I have a script that used to run daily that looked like the following to backup my mac. Backup script pastebin As you see here, this script is TERRIBLE because it deletes everything in the folder ...
1
vote
2answers
3k views

AppleScript To Manipulate VLC

I want to do a script, that it can launch VLC player, and in VLC player "Open a file", then "Select a folder", then click on "add" then "play" it. I think that Automator can't do this. But ...
1
vote
3answers
240 views

How to run a shell script from an AppleScript?

I am using a Mac running OSX Yosemite v.10.10.5. When I try to run my shell script from my AppleScript, I get the following error message: Error message at AppleScript Script Editor error "sh: /...
0
votes
1answer
25 views

How create an identical timestamp format as used in ppp.log file in a shell script?

In the need to add custom logging messages to ppp.log, I see that the date and time are missing when outputting the command to >> /var/log/ppp.log. Other pppd related messages in ppp.log are ...
0
votes
0answers
17 views

Silent installer for remote machines

I am trying to create a script to install logmein silently (or in the background) with out enduser input. I have the process to download the zip and create an admin user (for later login) however I ...
0
votes
0answers
44 views

AppleScript Remove Safari Cache but keep cookie and history

I want to get rid of Safari cache and website data but keep cookies and history. The script will be added to my computer startup script for optimizing the system performance. I was considering this ...
0
votes
1answer
111 views

Is there a `watch` command native to Darwin/OS X?

I have a script that I'm trying to port from Linux to Darwin/OS X. The Linux version currently depends on the watch command, which doesn't appear to be installed on Darwin/OS X by default. What's the ...
0
votes
1answer
53 views

Clean shutdown/restart from terminal in 10.7+

I have a headless system that is controlled remotely that I need to shutdown/restart in an automated way (without the use of VNC or local keyboard/mouse). Using various commands via SSH or via my ...
3
votes
2answers
3k views

Double click in AppleScript

How do you write the command to carry out a double click with a mouse at a specific location in AppleScript?
3
votes
1answer
47 views

Need my automator script to display the regular shutdown prompt before shutting down

I'm using the script below to trigger a shutdown but I would like it to give me the normal warning menu with the 60 sec. countdown, I can't figure out the warning menu. tell application "finder" to ...
0
votes
1answer
186 views

How to create an Automator service to run a script on all files in a folder

I want to create a service using Automator to run a shell script on all files in a folder, say delete all log files. What I have done is Created a new service in automator. Added a "Run Shell ...
3
votes
1answer
150 views

Problems reconnecting to WiFi if connection is lost

In the area where I live there are frequent power outages for a few seconds. I am connected via a router, which (of course) restarts each time. Unfortunately my Mac (2011 MB Pro) does not ...
0
votes
2answers
88 views

How to write a script that runs whenever a new file is added to a specific directory?

I've never written a script for OS X, and I don't really know which scripting tool i'll use for this task. Here's a pseudo code for the script I want to build : whenever a new file X is added to ...
1
vote
2answers
40 views

Problem with scripted account deletion syntax

I'm working on an account cleanup script module that can handle the hidden and unhidden accounts we're creating in bulk on new MacOS systems. We've kept the logic simple to start. However I keep ...
1
vote
1answer
2k 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 ...
0
votes
0answers
17 views

Can a script-based Service be used to invoke speech output of selected text using VoiceOver?

The usual text-to-speech feature doesn't work with the user-customized pronunciation from the VoiceOver settings. Could this shortcoming be worked around using a script and Service via Automator?
9
votes
6answers
34k 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
0answers
33 views

Error in dtrace script that print process cmdline + parent name.

I'd like to have dtrace script that for every new process, print it's commandline + it's parent process name. here's my script : #!/usr/sbin/dtrace -s proc:::exec { self->pexecname = ...
4
votes
1answer
101 views

How to create a service that puts selected text into quotation marks?

I'd like to create a service that puts any text I select in TextEdit or web page text editors into quotation marks. I understand Automator is the tool to use, but how do I create this action using ...
1
vote
1answer
37 views

osascript dialog box is blocking.

I'm using osascript to display dialog box from bash script, but it's blocking the script, until i press the 'ok' button. I wonder if there's a way to make this display window asynchronous. osascript ...