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
1answer
24 views

Catalina: How to add System Events to System Preferences > Security & Privacy > Privacy > Automation?

The problem In a script I'm using AppleScript to reload the browser when a change happens. I start this in the builtin terminal of my IDE, WebStorm. Since MacOS Catalina this yields the following ...
0
votes
3answers
47 views

Batch print with printer preset in MacOS

I have 50+ documents to print with the exact same printer settings and I'm trying to batch print them using the existing printer preset. What I've done so far: open all documents in one preview ...
0
votes
0answers
18 views

Automating sorting process for files in a folder based on same prefixes in their filenames

Okay, I have a directory that is the output directory for generated screenshots for a media player I use on a macbook (OS X High Sierra). I take a multitude of screenshots to review video files and I ...
1
vote
0answers
25 views

Mounting problems with autofs and executable maps

I wanted to replace my already existing and working autofs mount to my NAS with a script variant, which additionally wakes up the server via WoL if necessary and requests the password via keychain. ...
0
votes
1answer
40 views

I want to create a script in script editor that will press a key and then press enter every 60 seconds

I want to create a script in script editor that will press a key and then press enter every 60 seconds. However, I don't know how to make a script that presses a key. Does anybody know how to make a ...
0
votes
2answers
27 views

Using terminal and the open command I am trying to open a new browser instance followed by 2 tabs

I can open a new single instance using open -na "Firefox" --args --new-window "https://website.com" however I can't seem to get my script to open a second tab populated with a second url address after ...
2
votes
1answer
30 views

Query Apple's Servers for Update Using Script?

Is it possible to have a script or some sort of command-line tool that will query Apple's update servers to see what the latest version of an OS is? For example, I'd like to alert somewhere when a new ...
0
votes
0answers
33 views

How can I make a script containing passwords secure?

I have made a simple script : sysadminctl -adminUser AdminUserHere -adminPassword AdminPasswordHere -addUser NewUserNameHere -fullName "Full Name Here" -password NewUserPasswordHere Now the system ...
1
vote
1answer
32 views

Can I run a script in the background? (Apple script editor)

I have a script on apple script editor for a discord bot. (Discord is a chatting app my friends and I use) The discord bot is called "Dank Memer" and basically there are coins that you can get by ...
2
votes
0answers
24 views

Automatically copy files to a flash drive in terminal

I am trying to make a script that will automatically copy any files in the home directory with the extension .txt. What commands should I use in Terminal to search for and copy any txt files to a ...
0
votes
0answers
6 views

Scripting Mail.app

I use a service that regularly sends me an e-mail message containing a link to a downloadable file. The messages follow a standardized format that is easy to parse. Something like Standardized ...
0
votes
1answer
21 views

Need a script to connect to wifi based on user logged in

I know nothing of macs, just windows, but I need a script to connect to a specific wifi ssid based on the currently logged in user. Is this possible? This is not a school project; I need this for my ...
0
votes
0answers
17 views

A simple way to replace date created with last opened date? [duplicate]

I have a huge number of files that were copied into an old OS X 10.6 server. Problem is there are a large number that came over with a time last opened but no create or modified dates. Is there a ...
0
votes
1answer
22 views

Auto run a shell script when connecting to a network? (wifi or utp)

Is there a way to make macOS run a custom script whenever it (re)connects to any WiFi or Ethernet network? Basically, whenever my macbook connects to any network (wired or wireless) I would like to ...
1
vote
1answer
64 views

Extract e-mail addresses from large text file [closed]

Is there any way I could search through a load of text documents and extract the email addresses from it into one new document? I have this so far in Automator: #!/bin/bash Report=/Users/me/Desktop/...
0
votes
0answers
23 views

Create Multiple Output device via script or terminal

My Goal: I'm trying to let some "non-techy" users to share their internal audio in some applications. All would be done with some script or really, really basic actions (manually create a multi-out ...
1
vote
1answer
27 views

Trigger custom script on specific log message

I am using AirServer for Airplay on my Mac. As far as I know, AirServer does not provide an interface to run scripts on specific actions. However, I found a AirServer specific message inside the ...
0
votes
0answers
49 views

file not found error in shell script called from Automator

I want a shortcut to a script that merge video and audio. If I go in terminal to the directory documents/convert and run the script with ./script.sh everything works. If I copy the script in ...
0
votes
0answers
24 views

How can I set what computer uses the secondary monitor with a script?

I have two computers, an iMac 27" and a MacBook Pro, both running Mojave and a Thunderbolt 27" display. Both computers are linked to the external monitor through a thunderbolt cable. I primarily use ...
0
votes
0answers
22 views

Create GIF from Screenshots

Hello everyone, I need to create a program to take a set of screenshots and converrt them into a GIF. I've currently got this code in Shell which works, but the output is quite choppy. cd "~/....
0
votes
1answer
40 views

How can I write a script that opens a notification?

Is there an apple script that can click on the notification for me so that I don't have to open the app using a mouse? I plan to bind this script to a keyboard shortcut and that way I can open ...
0
votes
0answers
18 views

How to get the size of a file or directory in JavaScript for Automation

How do we get the size of a file or directory in JavaScript for Automation? I see some folder and item entries in the Dictionary, but I can’t figure out how to call them.
0
votes
1answer
22 views

how to set afplay as default media player for wma files in mac OS

Hi I am using a vim plugin named eblook which turns vim console into a dictionary. The problem is that the implementation of the plugin is using a default player for WMA file to play the sound file (...
1
vote
0answers
19 views

How can I fix my USB volume control from changing the volume two steps at a time?

I have this USB volume control, but when I adjust the volume, it adjusts it two steps at a time. When I connect it, it registers as a USB keyboard. My guess is that it is sending the "keypress" for ...
0
votes
1answer
87 views

How to use Launchd? [duplicate]

(sorry if this is a bad question. I am new to apple coding) I want to run a .scpt file at a specific time, once a day, every day using launchd (if there is a better way please tell me) I am running ...
2
votes
2answers
54 views

Applescript app keeps crashing

Whenever I try running this code it does not log the text. repeat set myTime to (time of (current date)) set precisetime1 to 82800 set precisetime2 to 84600 set ...
0
votes
1answer
39 views

Run Script Atomically

I have a launchd task that runs a bash script periodically, and this works great. However, if I change the script while the task is running, either by editing it directly, or swapping it with an ...
1
vote
1answer
18 views

“File is Locked” message for a folder with thousands of subfolders/files

After transferring a massive code project to my Mac, I noticed I couldn't write anything to the files inside due to the "File is Locked" plus an access denied message. Unlocking the root folder didn'...
0
votes
2answers
36 views

How do you git fetch all repos in a folder?

I keep all the repositories I work on in a folder on my machine ~/Code, and I want a script to execute git fetch && git status against each of the repos in that folder. I imagine that, if it’...
2
votes
0answers
24 views

How to script Catalina Security & Privacy Preferences

In my line of work we use LanRev for our remote management. However, with new machines using Catalina, we've had to manually allow Full Disc Access in order for remote control to work. Is there way ...
0
votes
1answer
61 views

Can't authenticate using SSH key when running script via launchd

I have a Bash script that executes an rsync command to sync files with a remote server. #!/bin/bash rsync -auvzP --exclude=.bundle --exclude=node_modules --exclude=tmp '/Volumes/Norman Data/me/....
0
votes
1answer
75 views

MacOSX El Capitan - Running bootstrap-vcpkg.sh results in a build stopped: subcommand failed, any solutions?

When running sudo ./bootstrap-vcpkg.sh, the script stops resulting in a ninja: build stopped: subcommand failed. I have no idea how to continue from here if anyone could help that would be greatly ...
1
vote
0answers
27 views

MacOSX El Capitan - After using command line to create a new user, why won't the user appear in the login screen on bootup?

Using sudo dscl to create new users with and without admin privileges. The newly created users for some reason are not in the login screen on bootup and using the input entries for users do not login ...
0
votes
0answers
25 views

Show FaceTimeNotificationCenterService

I wonder how I can show FaceTimeNotificationCenterService again if I run the command killall -kill FaceTimeNotificationCenterServicebefore?
2
votes
1answer
458 views

How to add a confirmation prompt window to warn before closing a window for any application?

This is about adding a Warn-Before-Closing Confirmation Dialog Window to all application windows in macOS before closing a window. How do I add a Confirmation Dialog Window when I click the Red X ...
0
votes
0answers
11 views

Can I write a script which caffeinates itself?

I have a couple of bash scripts which I almost always start and then walk away from my computer to let them do what they do unattended because of how long they take (and because they are often ...
0
votes
1answer
97 views

Automator/AppleScript: move folders to a location based on their name

I'm very new to scripting and Automator but I am trying to figure out a way to have folders automatically moved to a desired location based on the beginning and ending of their names. for example: If ...
2
votes
1answer
72 views

AppleScript 'choose from list'. How can I run a different command if multiple sections are chosen?

I have an AppleScript which manages my home made After Effects render farm. The farm is made up of three render machines. The script asks the user to make a selection of what machine(s) they want to ...
1
vote
1answer
75 views

Run shell script by double clicking in non-login prompt in terminal

This question is super similar to this, but I'm curious how to launch the shell script in a non-login shell prompt. I already have it set up to run with iterm2 when I double-click. I don't really care ...
0
votes
0answers
23 views

Links in HTML files opened with qlmanage don't work

I'm attempting to open HTML files using qlmanage. They open and render correctly, but whenever I try to click on a link, it takes me to Safari and then nothing happens. No new tab, no webpage. If I ...
3
votes
1answer
47 views

How to delete directory content with launchd

I am trying to empty a directory at the end of the day, so I have written the following script: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "...
0
votes
1answer
80 views

Where to find docs for the supported actions for `tell application` statement

Where to find docs for the supported actions for tell application statement. Similar to tell application "Finder" to close every window How can I know that Finder is supported and also close every ...
0
votes
0answers
124 views

Requiring user input in order to run a script which controls Safari

Using Script Editor, I've created the following script to close tabs and open a particular window: tell application "Safari" repeat with i from (count of windows) to 1 by -1 repeat with j ...
1
vote
1answer
29 views

How to find the “configure” shell script in MacOS Catalina?

In order to compile Grace-5.1.25 I need to run configure first. But configure does not seem to exist. In earlier versions of MacOS I used configure several times. Does anyone know where I can obtain ...
0
votes
1answer
39 views

Running perl shell script from AppleScript on Mojave

I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz). It used to work ...
1
vote
0answers
34 views

How to open a window and tab in Terminal via Javascript automation

I want to use the Script Editor program to create a script (Javascript) that will recreate my Terminal window and tab setup. I open a few windows, open tabs within those windows, label the tabs, run ...
0
votes
1answer
169 views

Run script on login *as root* on Catalina

In this question, a response details that com.apple.loginwindow login hooks can be used to run script as root on user login. I have followed the instructions by using sudo defaults write com.apple....
0
votes
1answer
40 views

Why does Automator not see new files in subdirectories on a Flash Drive?

I've created an automator app to find all the csv files on a flash drive, then modify and copy those files to a directory on the hard disk of my MAC. The automator app uses a shell script to compare ...
1
vote
1answer
204 views

Why would a python3 script not find a module when run in Automator?

I am trying to automatically run a python script using automator. This script python3 ~/Desktop/python/gmaps.py works fine in terminal but not when I try to run it through Automator , I get a "module ...
1
vote
0answers
69 views

ApplesScript, autopress space bar

I am trying to run a script that will double press space bar in a fast sequence after this command repeat 10000 times tell application "System Events" to keystroke "g" using command down ...

1
2 3 4 5
13