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)

1
vote
1answer
17 views

Connection is invalid error when running Applescript and Safari

The following applescript waits for a page to load before continuing with the do javascript "document.body.innerText" part of the script. It seems to work really well except for one thing. If Safari ...
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
17 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 ...
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 ...
0
votes
0answers
33 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 ...
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
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 ...
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 ...
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 ...
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
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 ...
-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
3answers
242 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
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
112 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
1answer
48 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
2answers
91 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 ...
0
votes
1answer
188 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 ...
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 ...
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
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
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?
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 = ...
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 ...
1
vote
1answer
54 views

AppleScript: Display alert or restart when application terminates/crashes?

I rely on Dropbox for syncing work files between two computes that are powered on 24/7. For some reason, Dropbox terminates (crashes or quits) after long periods of time, with no explanation. I just ...
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
79 views

OSX - Button spam help?

I want to be able to spam the jump button without having to hit the space bar multiple times, and I have a line of code but I'm not too sure what it is doing. tell application "System Events" ...
1
vote
0answers
16 views

Applescript claims to run shell script, but script has no effect [duplicate]

So I have a bash script like this: #!/bin/sh FILE='some_file.js' gsed -i -E 's/something/somethingelse/' "$FILE" echo "Modified File" When I run this from command line, it echoes the last line, so ...
1
vote
0answers
17 views

Mass Change Security to Mac App only option

looking to see if others have created a successful way in using ARD to deploy a script to change the security settings from Mac App & Identified developers to Mac App store only. OSX - 10.9.5 ...
0
votes
1answer
23 views

Executing executable file by means of script file

For executing file in linux terminal we run something like this: ./sflm -start Now, if i want this procedure is done by executing a script file what should i do ? I want to for example run this ...
4
votes
1answer
82 views

Change font of Terminal programmatically w/o restarting

At home I've got a nice big display that unfortunately does not have the same resolution as my retina macbook does. I'd like to use a pixel-font on the low-res screen and a nice smooth one on the ...
0
votes
0answers
55 views

Run Script at Shutdown

Is no way to run a shell script immediately before system is switched off? What I found via google was just to use rc.local.shutdown or so, but it seems that this function was kicked out on previous ...
0
votes
0answers
35 views

OSX handling of USB Drives and Permissions - need clarification/explanation

I'm new to the site, and well, new to MACs. I have an image (dual boot yosemite and win7) on some old iMACs, late 2009s. When I deploy this image, sometimes my bootmenu disappears and I have to ...
1
vote
1answer
104 views

What is the crlcache keychain and why do I have so many of them?

I run the keychain command-line app that allows me to fast-sleep my Mac or quickly lock a keychain. However, it seems to think that I have many crlcache keychains: When I search for crlcache on my ...
1
vote
1answer
70 views

Setting anacron on Mac - Shell Scripting

I set cron to run script every day using env EDITOR=nano crontab -e where I wrote something like this @daily path/to/sript.script. Now I want to use anacron to be sure that script is going to be run ...
1
vote
1answer
22 views

Packet sending script, iOS 9.1

I have an app which sends specific packets to a server every time I press a particular button on the app, the problem is that I need to press it every 30 seconds during a few hours and it's annoying. ...
0
votes
1answer
31 views

How to trigger a bash script from right click in Safari on a particular URL?

is it possible when I'm in Safari and have link (URL) to trigger a bach script with an right mouse option? The bach script should be run with this format: bash scriptname.sh -parameter -parameter ...