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)

3
votes
0answers
259 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 ...
3
votes
0answers
374 views

How to detect locked screen / login-session from a script?

I am looking a way for a script (either bash or AppleScript, doesn't matter) to detect whether the state of the screen or the user login session is locked or not (i.e. the user will need to type in ...
3
votes
0answers
236 views

Can I use the Terminal to find all OpenMeta tags on my system?

I know that there are apps that can do this, so I figure it must be possible: I'd like to compile a list of every OpenMeta tag that I've used on my Mac (OS X 10.8.3). But here's the rub: I'd ideally ...
2
votes
0answers
32 views

How can I detect an incoming call on Yosemite

I'd like to detect an incoming Facetime call and run certain scripts as a result. I'd like to achieve something similar to when iTunes pauses when there is an incoming call, but I would run my own ...
2
votes
0answers
33 views

Run script when I connect something to the line in port?

I'm connecting my phone to my mac via the line in port to listen to podcasts. I'm using the app LineIn to do this and I was wondering whether there was anyway I could have: My audio input be set to ...
2
votes
0answers
146 views

How can I tell programmatically whether a process is in app-nap?

I'm looking for a script, built-in shell command, or program (with sources) that can tell me whether a process is in App-nap mode or not. I want to use it in automated testing, for profiling and to ...
2
votes
0answers
727 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 ...
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.
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 ...
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
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 ...
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 ...
1
vote
0answers
97 views

Get latest Time Machine backup when backup disk is unplugged

I know i can get the time stamp of the latest Time Machine backup with the command tmutil latestbackup | grep -E -o "[0-9\-]+$" but this only works when my backup disk is plugged in. If not, i get the ...
1
vote
0answers
49 views

Copying AFP Path with Automator

I'm updating a Service I created in Automator a few years ago that copies a file path with a certain format in order to be clickable in "Messages". The problem now is that it doesn't work with new ...
1
vote
0answers
311 views

Automate/wrap a few SH scripts in one - Deploystudio

Right now I have a few .sh scripts that are being deployed via Deploystudio. I've created seperate scripts and tasks for each command. Though, it doesn't really function. The logs tell me that I need ...
1
vote
0answers
203 views

Create a script to turn wifi off on shutdown

Is there anyway to create a script that will automatically shut down the WiFi when I power down my machine? Maybe in Automator?
1
vote
0answers
959 views

Applescript / Automator - Pass variables between them

I have a question about how to pass the applescript input from one computer to another computer's automator input (I created it as a program). I've created the script below to ask for the filename and ...
1
vote
0answers
197 views

Why won't this script bind to my server?

I am trying to figure out why this script is not binding client computers to the OD server. It is a firstboot script that is part of a netrestore image that runs at login. It does seem to run ...
1
vote
0answers
61 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 ...
1
vote
0answers
176 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
0answers
102 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 ...
1
vote
0answers
256 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 ...
1
vote
0answers
258 views

How can I detect and remount my time machine sparsebundle?

I currently have my Time Machine sparse bundle residing on a network drive plugged in to my router. I have a script that runs at login that auto connects to the shared drive and mounts the ...
1
vote
0answers
625 views

How can I create (nested) Keynote.app slides from a XML file?

I have some nested lists (XML/OPML file) and I am looking for a (automated) process to create Keynote presentations from them. Use case: I write concepts for presentations in an Outliner, then would ...
1
vote
0answers
187 views

How can I make an Apple script for iCal event?

I'm trying to find a script to create a specefic type of event with iCal. Actions that I'm looking for in the script are: Create an event Choose a time and date Choose an alarm Choose a specific ...
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 ...
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
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.
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
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 ...
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
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?
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 ...
0
votes
0answers
43 views

Disable iTunes using a Script?

There's a much despised bug in OS X wherein iTunes unexpectedly opens and in some cases, starts playing music, a podcast, or whatever the user was listening to last. The bug can be triggered in a ...
0
votes
0answers
36 views

Execute macros or scripts based on Magic Trackpad 2 Force Touch

I’m looking at getting a Magic Trackpad 2 with Force Touch, but want to know if I can create macros for the Force Touch actions? I’m not taking about the the built in basic Apple support, but full on ...
0
votes
0answers
15 views

How can I import a text file of emails into Mail?

I have thousands of emails from the nineties that were exported as a text file that I'd like to import into Mail. I'm looking for a way to do that directly or indirectly. I'm assuming it will require ...
0
votes
0answers
32 views

Encrypt password on disk for scripting

In the Microsoft Windows platform, there is a service called the Data Protection API (DPAPI), which allows developers to easily encrypt and decrypt values using a simple set of APIs. The encryption ...
0
votes
0answers
24 views

Disable sync services on battery

How to automatically disable sync services like Dropbox, Box, Eye-fi Helper, and Crashplan when I'm on battery power and re-enable it when I'm plugged back in? I've noticed my battery drains a lot ...
0
votes
0answers
19 views

Startup Script Removal

Is there a good way to remove a script that was set to run at startup on a 10.10.5 macbook, that fails and never runs to completion? If the Script could complete normally it would remove itself, ...
0
votes
0answers
122 views

How to send emails programmatically using scripting bridge if sandboxing is enabled

How to send emails using mail scripting bridge after enabling sandboxing. I am able to send mail before enabling sandboxing but failing after enabling it. As per my understanding, user permission is ...
0
votes
0answers
25 views

Have URL scheme handled by shell (or other) script

I want to create a custom URL scheme, say x-camptown-races-sing-this-song-doo-dah-doo-dah, such that when I open a URL such as x-camptown-races-sing-this-song-doo-dah-doo-dah:foobar, it gets handled ...
0
votes
0answers
350 views

Enable remote management remotely on a mac

I am trying to use remote desktop to send a script to all Macs on my network that creates an additional admin account and hides it. I am trying to do this using Apple Remote Desktop. However most of ...
0
votes
0answers
47 views

Script to organize photos

I have a bunch of photos in different folders and I would like to organize them into a single directory structure. Many of the photos are duplicated. I would like to organize them into year/month ...
0
votes
0answers
144 views

Conditional lsof loop in bash script

I found this example of a conditional lsof loop and want to adapt it to my situation. typeset fSrc="/path/to/sourcedir" typeset fTgt="/path/to/targetdir" while : ; do ls /path/to/sourcedir | ...
0
votes
0answers
18 views

osx automation using spaces

My ultimate goal is to write an automation script that will collect all the open safari windows in a specific space and spit out the URLs. Can spaces be addressed using scripting?