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
0
votes
0answers
13 views

osa script to get user input with if condition

I want to run osa script to run in self-service application. first this line needs to be displayed: osascript 'tell app "System Events" to display dialog "Save and close all your files and ...
0
votes
0answers
21 views

Applescript service which utilises “on idle”?

I have been trying to run a script on a recurring basis via an apple service. Most answers I have seen have been are for 'stay-open' apps - whilst this possibly works as a solution and I have glanced ...
0
votes
1answer
19 views

No Prompt & Password Fill Install for Homebrew

I'm trying to create a script to deploy macOS and the last piece that isn't automated is installing Homebrew. Because of the unique scenario where Homebrew shouldn't be installed with sudo, and it ...
-1
votes
2answers
24 views

Unminimize window Apple script not working when upgrading from El capitan to Mojave

I have an Apple script that I found somewhere that unminimizes windows. It worked on El Capitan but now it doesn't in Mojave. I assume there was a change of syntax but I know nothing about apple ...
0
votes
1answer
25 views

Automatically download software update over a specific network

I want my mac to automatically download updates for me only if I am connected to a specific WiFi network. Is this possible with a script? If so, how?
2
votes
1answer
55 views

Can I tell Terminal that it is allowed to kill processes if asked?

Mojave on my iMac routinely applies its own updates and reboots itself, with most running programs returning to a reasonable copy of their pre-reboot state. That's fine, especially since these updates ...
0
votes
2answers
42 views

How do I write folder-agnostic shell script on Mac as I can do in Windows?

I would like to write a set of shell scripts which would execute smoothly on Mac disregarding where they are called from. I am currently struggling about how to implement this. On windows, I could ...
0
votes
1answer
43 views

dsconfigad returns error “authentication server could not be contacted. (5200)”, but GUI domain join works without a problem

So I've built a "script", to deploy using JAMF. It is pretty much a single command. It looks like this: dsconfigad -add "SERVERNAME" -force -computer "COMPUTERNAME" -domain "SELECTED_OU" -username "...
3
votes
3answers
105 views

Mac OS X - Bash script if statement based on system status

Creating a bash script and using the if statement, how do I execute a command based on a system status? if a specific system status is enabled do something, else do something different? I give you a ...
1
vote
1answer
36 views

How do I stop an AppleScript script that is stuck in an endless loop without restarting my Mac?

I stupidly ran an AppleScript script on my Mac running macOS Mojave and the script is running in an endless loop. I thought something obvious like pressing the Esc key would end the program. However, ...
1
vote
1answer
97 views

change all .sh files to executable by terminal

i hate retyping chmod +x filename and insect to run from terminal. how do i set this for all .sh files ? I've tried Inspect then manually setting the extension
3
votes
1answer
107 views

Is it possible to send a text file from terminal to the Notes App on MacOS?

I like how my notes in the Notes App gets synced via iCloud. I spend most of my time in the terminal during the day, so it's convenient for me to keep notes in a text file. At the moment I simply copy-...
2
votes
0answers
41 views

Create Local Network Directory User on OS X server via Terminal

I found this post: How can I create an Open Directory network user with a command? but it didn't have any answers on it. I know there's a way to create a local network directory user, but I cannot ...
10
votes
2answers
793 views

How to md5 a list of filepaths contained in a file?

I have a folder containing many folders containing many files. Thousands. I can do find . -type f > ./FILE-LISTING.TXT to create a file containing many thousands of file paths that looks like this:...
4
votes
1answer
103 views

Search folder, copy to new folder and change names of the files!

So I'm trying to recursively search folder, and as you might imagine it will be the "Photos"-folder in MacOS. And in the process, I would like to change the file name, why you might ask? Because ...
3
votes
0answers
55 views

How can I detect which button was clicked in the DMG EULA confirmation screen

I'm using the open command to automate (via bash) opening a dmg which has a EULA attached to it. When I run open my_app_distribution.dmg I get a screen that looks like this: The open commands uses ...
0
votes
1answer
17 views

Pinning Apps to dock VIA terminal or installation arguments OS Sierra

I am using meraki MDM systems manager to deploy applications for are teachers. It would save me a-lot of heart ache to be able to include a terminal command or some type of software to help with ...
2
votes
0answers
28 views

How to start an application when iPad is connected?

I would like to start an application (Duet.app) installed on my macOS 10.14.5 whenever I plug my iPad to the USB port. I tried to do it with Automator, but I have no experience.
2
votes
0answers
36 views

How to see LaTeX output in Mail.app?

I frequently receive mails with LaTeX text which appear in normal text like $frac{(1+cos\theta)^2 but I want them to be rendered in Mail.app as it would be written in books. Is there any plugin or ...
1
vote
3answers
177 views

Finding and Renaming Mislabeled Duplicates

I inadvertently formatted a Time Machine backup external hard drive. I was able to recover many of the files, but not the names of those files. All of the recovered files have generic names like "...
0
votes
0answers
20 views

Smart Folder from arbitrary script output?

This is a long shot, but is it possible to create a Smart Folder which, instead of building its search using the Search Criteria UI, but instead use the properly formatted output of necessary for a ...
0
votes
2answers
263 views

Connect and run commands over SSH using script

I'm using a series of commands for deploying my files to production. This is currently done manually. Is it possible to make these commands into an executable file? So that I don't have to copy paste ...
1
vote
0answers
28 views

Help with Apple Script for dealing with duplicates in Numbers

I had a script that I used to find duplicates in a numbers document and to highlight the duplicate in red. Well I now have a file where there are multiples of the descriptor in column B that are ...
0
votes
1answer
40 views

stderr error log from launchd scripts filled with non-errors

I've added versions of the following to each of the launchd plist files for all of the scripts I run on my server: <key>StandardErrorPath</key> <string>/script_logs/server....
-1
votes
1answer
111 views

Automator services replace selected text's spaces with underscore [closed]

Looking to create a simple automator service that I can use when selecting text. If the text has spaces, it will replace it with underscores. Thanks in advance.
1
vote
1answer
88 views

Keyboard shortcut in finder to launch >share via>airdrop

I'm for a way to share a group of selected files I have selected in the finder window, via airdrop, with a simple keyboard shortcut. since you can use cmd+c to copy, I thought there had to be a way I ...
1
vote
1answer
59 views

automating “Reset Advertising Identifier” is it possible?

I want to use osascript or some other way to automate "Reset Advertising Identifier" is it possible?
-1
votes
1answer
22 views

Start a window on top of a full screened space [duplicate]

How can I open a window on top of a full screened space? I full screen a video in Safari. I want to run some app that opens a little window on top of that full-screened video. I don't mind what ...
0
votes
1answer
77 views

How can a script detect if it has access to some Security & Privacy parameters?

I've created a script which uninstalls an application I've created. However, as you may know, in macOS Mojave the system requests the user's permission to allow said script to control System Events. ...
1
vote
1answer
95 views

Automator to remove all text before hyphen ( - )?

I'm trying to create an Apple Automator application that will rename a group of files by removing all text before and including a hyphen ( - ) that will post an error if trying to rename a file with ...
0
votes
1answer
14 views

Power off block devices

I would like a way to shut down the block devices to do safe removal by turning them off. On Linux there is the UDisks2's udisksctl power-off -b /dev/sdX command. Is there something similar? Or if you ...
0
votes
1answer
87 views

How to remove special character from a folder name?

I am creating a folder like mkdir -p ../service/target/static but windows creates it with some special character static. I need to explicitely remove that special character using shell script. I ...
0
votes
1answer
350 views

error “System Events got an error: Can’t get application process \”System Preferences\“.”

When running tell application "System Events" click button "Turn Bluetooth Off" of window 1 of application process "System Preferences" end tell I get the error: error "System Events got an ...
1
vote
1answer
61 views

Monitor Folder Contents with launchd - Including Subfolders?

I want to make a shell script that runs any time the contents of a particular folder on my server are changed. Seems easy enough at first, because launchd has a directive called WatchPaths which ...
0
votes
1answer
32 views

Network proxy setup in terminal

I am trying to create a bash script that will update the mac's proxy settings and a few other places when a user changes their password every 60 days. So far I am trying to use this command for the ...
0
votes
0answers
30 views

Finding a file in Finder with a script

someone please explain why this won't work. The script alone without the "if mainReturned = "File" then" works just fine but when I add it to another part of a script, things get weird. It highlights ...
2
votes
2answers
55 views

Opening a script with a script?

I am using a script and I have a secret code to input within the script (If that makes sense) after I input the code, it is supposed to open the script within the application, the main.scpt. I don't ...
3
votes
2answers
488 views

Getting a text file with the url of open tabs

I got used to this routine my idle times: Open hacker news, SE, other sources on my iphone. Open interesting links as new tabs. Read for a while. Leave tab to remind myself to save it somewhere. The ...
0
votes
0answers
50 views

How to open a second finder window in split view when the current window is in full screen view

Let's say I have a finder window open in full screen view. I'd like to quickly open a second one, where both would be in the same split view. Sort of like using command-tab. And preferably to the ...
0
votes
1answer
57 views

Play folder with right button with iTunes

This answer to Play folder with right button with VLC explains how playing all the audio tracks within a folder can be accomplished when using VLC. I don't want to install VLC, how can I accomplish ...
0
votes
1answer
92 views

Different execution of bash script in 'execute shell script' action in Keyboard Maestro

I try to execute shell script using Keyboard Maestro. In macOS Terminal and Raspberry everything works good. KM shows a strange error. Looks like the script works but poorly recognizes characters or ...
1
vote
1answer
42 views

Create a custom Quick Action to create a zip file with password

How to create a custom Quick Action to create a zip file with password. I understand, to create a zip file with password the following command-line can be used: zip -er archive.zip /path/to/...
2
votes
1answer
392 views

Giving instructions to an executable in UNIX?

I'm pretty new at this, so excuse me if this is too easy. The thing is, I have a bunch of instructions stored in a text file named: 'FTIG_dldStruct.txt' and I want to write them all into an executable ...
0
votes
0answers
36 views

How and why is the osascript command loading a QuickTime component?

I'm trying to figure out what the osascript command is doing under the hood. Whenever I run it, it tries to load a QuickTime component which throws security errors with Mojave installed. See this ...
3
votes
1answer
313 views

Notification center documentation for applescript

Where can I find documentation for notification center method and properties to use it in applescript? I can't find anything in script editor's dictionary neither on web. This is example code to work ...
2
votes
1answer
62 views

Easy way to bulk change folder icons in Mac

In order to change the icon of one MAC folder, all we need to do is: Open the image Copy the image from the menu ("Edit" -> "Copy") Right Click on the folder and click "Get Info" Click the icon at ...
3
votes
1answer
107 views

What does “Cache location entry for Photos.app in cache file” error signify in Automator app?

I have written a very basic script to count the number of files in a folder, then if it reaches 16 files, to run an automator workflow, as below: #!/bin/bash cd /Users/barbooths/Projects/...
0
votes
0answers
25 views

How to display standard output in Mac application converted from shell script?

It's easy to convert a shell script to a Mac App as suggested here. But I am only able to see the operation result of the script(or the Mac App) after the script finished and there seem to be no easy ...
0
votes
1answer
173 views

Script to check to see if certain applications were installed [closed]

I am very new to Macs however I did hear that there was a Bash script that can be utilized to check to see if certain applications were installed on a machine
0
votes
1answer
72 views

Removing Files after Successful Extraction unrar rm shopt globstar

shopt -s globstar for f in **/*.rar; do dir=`dirname "$f"`; unrar e "$f" "$dir" && rm -frv "${f::-2}*"; done From echoing out testing the rm command, the file is the correct path. I ...